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 - SDL_WM_SetCaption memory leak.
Summary: SDL_WM_SetCaption memory leak.
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: *don't know* (show other bugs)
Version: 1.2.9
Hardware: PowerPC Mac OS X 10.4 (Intel)
: P2 major
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-10-03 08:51 UTC by Gavin
Modified: 2007-12-29 12:43 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.