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

Summary: double [release] error
Product: SDL Reporter: Vittorio Giovara <vitto.giova>
Component: videoAssignee: Ryan C. Gordon <icculus>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: major    
Priority: P2    
Version: HG 2.0   
Hardware: iPhone/iPod touch   
OS: iOS (All)   
Attachments: fix the double free error

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