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 498

Summary: SDL_WM_SetCaption memory leak.
Product: SDL Reporter: Gavin <zombiebovine>
Component: *don't know*Assignee: Ryan C. Gordon <icculus>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: major    
Priority: P2    
Version: 1.2.9   
Hardware: PowerPC   
OS: Mac OS X 10.4 (Intel)   

Description Gavin 2007-10-03 08:51:27 UTC
I've listed it as major because, assuming you update your window caption every 100 ms, the application becomes unusable within an hour. Perhaps a higher severity would be appropriate.

This code leaks memory at an alarming rate:

while(1){
    SDL_WM_SetCaption("memory footprint increaser","memfoot");
};

No doubt this has gone unnoticed because most people only call this during initialisation. I noticed it when I started using the function to report gamestates on my opengl game. 

I've tried it in a more simple application, initializing SDL_VIDEO, creating a display surface and then running the loop. memleak still present.

Sorry, not tried other OSes, only OS X 10.4.10 INTEL.
Comment 1 Sam Lantinga 2007-12-29 12:43:00 UTC
I just tried this with SDL 1.2.13 PRERELEASE (http://www.libsdl.org/tmp/SDL-1.2.tar.gz) on Mac OS X 10.5.1 and it seems to be resolved.

Feel free to reopen this bug if you're still seeing the bug with the latest version of SDL.