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 1641

Summary: avoid allocating nsstring from char*
Product: SDL Reporter: Vittorio Giovara <vitto.giova>
Component: videoAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: minor    
Priority: P2    
Version: HG 2.0   
Hardware: All   
OS: Mac OS X (All)   
Attachments: Patch avoiding leaks

Description Vittorio Giovara 2012-11-12 05:52:47 UTC
Created attachment 988 [details]
Patch avoiding leaks

Changesets 4f272256d172 and 42214b6959c5 introduce two neat features for logging and alertbox on ios and osx.
However the NSString allocated (and a few other objects) are not freed by the autorelease pool when created by +alloc and -initWithStuff: and this will create leaks. While negligible on osx, on mobile it's better not to have leaks.
Attached is a patch that should take care of the problems on both platforms. Please make sure the features still work as intended.
Comment 1 Sam Lantinga 2012-11-29 00:46:06 UTC
Looks good, thanks!
http://hg.libsdl.org/SDL/rev/146d1d7ecdc4