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 149 - memory leak in SDL_dx5events.c
Summary: memory leak in SDL_dx5events.c
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: 1.2.9
Hardware: x86 Windows (All)
: P2 normal
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-02-22 09:00 UTC by Danijel Kopcinovic
Modified: 2006-03-21 11:10 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 Danijel Kopcinovic 2006-02-22 09:00:00 UTC
In DX5_DestroyWindow routine, I got a memory leak. I was due to not freeing SDL_Appname variable. Here is my fix for this:
void DX5_DestroyWindow(_THIS)
{
	/* Close down DirectInput */
	DX5_DInputQuit(this);

	/* Destroy our window */
	if ( SDL_windowid ) {
		SetWindowLong(SDL_Window, GWL_WNDPROC, (LONG)userWindowProc);
	} else {
		DestroyWindow(SDL_Window);
	}

//! Added by Danijel Kopcinovic as a fix for memory leak.
  if (SDL_Appname != 0) free(SDL_Appname); SDL_Appname = 0;
}
Comment 1 Sam Lantinga 2006-03-11 19:57:50 UTC
I implemented a slightly different fix in CVS.  Could you check it out and make sure it does the right thing?
Comment 2 Danijel Kopcinovic 2006-03-21 06:20:29 UTC
I've downloaded the latest SDL zip, but I'm having problems with building. The docs indicate that I need DirectX SDK to build, so I downloaded and installed it, but the build does not work. It complains about not being able to find mmintrin.h. Therefore, I cannot affirm or deny if your fix is ok.
Comment 3 Sam Lantinga 2006-03-21 11:10:24 UTC
(In reply to comment #2)
> I've downloaded the latest SDL zip, but I'm having problems with building. The
> docs indicate that I need DirectX SDK to build, so I downloaded and installed
> it, but the build does not work. It complains about not being able to find
> mmintrin.h. Therefore, I cannot affirm or deny if your fix is ok.
> 

You need to install the VC++ processor pack.