Memory Leak in SDL?

Hi All,

I’ve got a small game I’ve been working on. (Developed in MS Visual C++
2003). When I set the SDL_VIDEODRIVER environment variable to “windib” (so
debugging is not so painful) the memory leak detector I was using reports a
heap of leaks coming from the SDL library.

When the SDL_VIDEODRIVER variable is not set, then no leaks are reported
(Apart from the string that makes the title of the SDL window, which I don’t
count.)

I’m fairly certain it’s not my code that’s causing the leak. Everything
appears to be deallocated correctly (and it works fine without the windib
variable). Has anyone else come across this? or have I messed up somewhere.

Cheers,
Matt.

I’m fairly certain it’s not my code that’s causing the leak. Everything
appears to be deallocated correctly (and it works fine without the windib
variable). Has anyone else come across this? or have I messed up somewhere.

Is there any more specific leak information from the tool? What sort of
things leak? Does it leak more if you do a bunch of blitting? Or is it
just when you create a window? How reliable is this tool? What tool IS this?

Sorry for the barrage of questions, but we’ll need to know more to
address the issue properly.

–ryan.

Er, nevermind :smiley:

I built a version of the SDL library in debug mode (because I wanted to
trace the execution into the DLL a while back), and I was still linking with
the debug build. I changed it to link with the normal release build and the
leaks went away.

Do you still want details of the leak?> ----- Original Message -----

From: icculus@icculus.org (Ryan C. Gordon)
Newsgroups: gmane.comp.lib.sdl
Sent: Monday, July 11, 2005 10:47 PM
Subject: Re: Memory Leak in SDL?

I’m fairly certain it’s not my code that’s causing the leak. Everything
appears to be deallocated correctly (and it works fine without the
windib

variable). Has anyone else come across this? or have I messed up
somewhere.

Is there any more specific leak information from the tool? What sort of
things leak? Does it leak more if you do a bunch of blitting? Or is it
just when you create a window? How reliable is this tool? What tool IS
this?

Sorry for the barrage of questions, but we’ll need to know more to
address the issue properly.

–ryan.