We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 2859 - Possible leak in SDL_DXGIGetOutputInfoin src\video\windows\SDL_windowsvideo.c
Summary: Possible leak in SDL_DXGIGetOutputInfoin src\video\windows\SDL_windowsvideo.c
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: 2.0.3
Hardware: All Windows (All)
: P2 normal
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords: triage-2.0.4
Depends on:
Blocks:
 
Reported: 2015-01-29 23:06 UTC by Coriiander
Modified: 2015-02-20 01:26 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Coriiander 2015-01-29 23:06:38 UTC
This report is about function "SDL_DXGIGetOutputInfo" in file "src\video\windows\SDL_windowsvideo.c".

The function attempts to release the resources acquired from DXGI_LoadDLL. It nicely releases the enumerated IDXGIOutputs and IDXGIAdapters. That's good. But at the end of the function, where you want to release the IDXGIFactory, you're actually incrementing its reference count (IDXGIFactory_AddRef) rather than releasing it (IDXGIFactory_Release).

The code, as it is now, says:

		/* free up the D3D stuff we inited */
		IDXGIFactory_AddRef( pDXGIFactory );
		SDL_UnloadObject(pDXGIDLL);

This should be:

		/* free up the D3D stuff we inited */
		IDXGIFactory_Release( pDXGIFactory );
		SDL_UnloadObject(pDXGIDLL);
Comment 1 Ryan C. Gordon 2015-02-19 06:32:15 UTC
Marking a large number of bugs with the "triage-2.0.4" keyword at once. Sorry
if you got a lot of email from this. This is to help me sort through some bugs
in regards to a 2.0.4 release. We may or may not fix this bug for 2.0.4,
though!
Comment 2 Ryan C. Gordon 2015-02-20 01:26:08 UTC
It appears this already got fixed as part of this commit...

    https://hg.libsdl.org/SDL/rev/135b8fef4adb

...so we're good to go here. Thanks!

--ryan.