We can see in the backtrace _CFAutoreleasePoolPop
.
It means that the crash occurred while the autorelease pool of the current run loop was trying to release an object that was marked for autorelease...
Usually, it means that an autoreleased object was released manually.
Imagine the following:
{
NSObject * o;
o = [ [ [ NSObject alloc ] init ] autorelease ];
[ o release ];
}
The o
object here has a retain count of 1
, and is marked for autorelease, so the current instance of the autorelease pool will send it a release
message next time it's drained.
So the manual call to release
, which is wrong, won't produce a crash, as the object is still leaving yet. But the object will then be deallocated, leaving the autorelease pool with a reference to a deallocated object.
When the pool is drained, it will then try to send a release
message to that invalid reference, and your app will crash.