IPhone development - memory issue

I am faced with this problem of releasing an already released object, but I cannot let my life know where the error occurs. I added the NSZombieEnabled flag and this is the log I get in gdb. Can someone please tell me how to solve this problem or rather find out where the error occurred.

*** -[CFString release]: message sent to deallocated instance 0x5e4780 
(gdb) where
#0  0x952ff907 in ___forwarding___ ()
#1  0x952ffa12 in __forwarding_prep_0___ ()
#2  0x9260e20f in NSPopAutoreleasePool ()
#3  0x30a564b0 in _UIApplicationHandleEvent ()
#4  0x31563dea in SendEvent ()
#5  0x3156640c in PurpleEventTimerCallBack ()
#6  0x95280615 in CFRunLoopRunSpecific ()
#7  0x95280cf8 in CFRunLoopRunInMode ()
#8  0x31564600 in GSEventRunModal ()
#9  0x315646c5 in GSEventRun ()
#10 0x30a4ec98 in -[UIApplication _run] ()
#11 0x30a5a094 in UIApplicationMain ()
#12 0x00002494 in main (argc=1, argv=0xbfffef9c) at /Users/adminUser/Projects/MyProject/main.m:14

Thanks.

+5
source share
1 answer

The autostart pool is trying to free an already released object.

This can happen if you manually release the object registered for autorelease

NSString* foo = [NSString stringWithFormat:@"foo:%d",42];  
[foo release];  /* this release is bad, as this object is already 
registered for autorelease */

You can use the following method to find the highlight point:

( ) - "" "". , , malloc_history.

+16

All Articles