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 - avoid allocating nsstring from char*
Summary: avoid allocating nsstring from char*
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: HG 2.0
Hardware: All Mac OS X (All)
: P2 minor
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-12 05:52 UTC by Vittorio Giovara
Modified: 2012-11-29 00:46 UTC (History)
0 users

See Also:


Attachments
Patch avoiding leaks (2.81 KB, patch)
2012-11-12 05:52 UTC, Vittorio Giovara
Details | Diff

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