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 1027 - double [release] error
Summary: double [release] error
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: HG 2.0
Hardware: iPhone/iPod touch iOS (All)
: P2 major
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-17 19:21 UTC by Vittorio Giovara
Modified: 2011-01-19 23:46 UTC (History)
0 users

See Also:


Attachments
fix the double free error (886 bytes, application/octet-stream)
2010-07-17 19:21 UTC, Vittorio Giovara
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vittorio Giovara 2010-07-17 19:21:36 UTC
Created attachment 521 [details]
fix the double free error

in SDL_uikitview the variable 'textfield' is initialialized and set to autorelease.
however in the dealloc method a second [release] is sent.
If the textfield has not been set to nil before (with a viewDidUnload for example) this can lead to awful hard-to-find crashes when the SDL code terminates.

the error message is
-[textfield release] message sent to deallocated instance 0x4e5fa90

the fix is simple, just release the object as soon as it is added to the subview, see attached patch
Comment 1 Sam Lantinga 2011-01-19 23:46:00 UTC
This is fixed, thanks!
http://hg.libsdl.org/SDL/rev/a69e36365766