Closed hartwork closed 1 year ago
Ok, we cleaned up most of the window, but there was a small memory leak because SDL_FreeSurface() refuses to free the screen surface's memory...so now we just make sure to NULL out the global that holds the screen surface pointer before attempting to free the object during SDL_Quit.
Good catch on this one, thanks!
@icculus I confirm that db10d6fc01a2a567ddf58e9890b3bbeb6fa5c77c fixed the leak, awesome! :+1:
Hi!
The SDL 1.2 docs on
SDL_SetVideoMode
say that:I noticed that this doesn't seem to hold true for sdl12-compat
SDL_Quit
, i.e. AddressSanitizer shows a leak with this minimal reproducer:This is with latest f52d7787f9f513a5a2ba99d92678af39a9548458 and I'm running the code like this (without need for any Makefile present):
The runtime output is this:
Adding
SDL_FreeSurface(window);
after (not before)SDL_Quit();
fixes the leak but also seems evil since SDL is already officially shut down and it's not needed with SDL 1.2. What do you think?Best, Sebastian