[SDL] SDL_FULLSCREEN memory leakage

David Olofson david.olofson at reologica.se
Wed Oct 16 04:57:01 PDT 2002


On Wednesday 16 October 2002 04:40, Jason Robertson wrote:
> dreadful bug I found while trying to make a simple
> fullscreen
> window under windows ME (but Im sure it all happens in
> all other windows..)
> and while running various SDL demos I found on the
> web.

Never seen it on Win9x or win2k, but I could have missed it, of course...


> SDL_FULLSCREEN
> Huge memory leakage/eats up a big chunk of memory when
> SDL programs lose focus while in fullscreen mode..
> minimizing and returning to fullscreen a mere 7 times
> will deplete all system resources and crash my (new)
> pc.. The memory seems to return if you exit the app
> before that happens, but this is still bad!

What kind of display surface are you using? (SDL_HWSURFACE, SDL_DOUBLEBUF 
etc.)


> Ive tried everything! there is no way around it
> besides switching to DirectX, or not using the
> SDL_FULLSCREEN flag within windows..
>
> And Im sure you know SDL_WM_ToggleFullscreen doesnt
> work in windows.. (why not?!)

Because that would require that the display surface struct is replaced 
every time you switch. AFAIK, the problem with that is that 
SDL_WM_ToggleFullscreen() was never defined as a call that may need to 
close and reopen the display, and thus, implementing it on Win32 would 
break many applications.


> I really hope this will get fixed in the new version
> of SDL.. !

I'm sure it will (the memory leak issue, that is), if someone can figure 
out what's actually going on.

Anyone seen this leak before?


> I dont know why SDL is moving on to dreamcast and Ps2
> when it doesnt even work in windows yet!

Probably because the people working on those ports are not the same 
people that are working on the Win32 support. How is stopping development 
on all other fronts going to help any particular target? *heh*

On the contrary, in my experience, working on multiple platforms at once 
results in the common code getting much more solid than if you work on 
only one platform. The different environments and tools have a tendency 
of revealing nasty bugs before they have a chance to cause real trouble.


//David Olofson - Programmer, Composer, Open Source Advocate

.- Coming soon from VaporWare Inc...------------------------.
| The Return of Audiality! Real, working software. Really!  |
| Real time and off-line synthesis, scripting, MIDI, LGPL...|
`-----------------------------------> (Public Release RSN) -'
.- M A I A -------------------------------------------------.
|    The Multimedia Application Integration Architecture    |
`----------------------------> http://www.linuxdj.com/maia -'
   --- http://olofson.net --- http://www.reologica.se ---




More information about the SDL mailing list