On 7 Jan 2013, at 22:15, Pirmin Braun <p...@intars.de> wrote: > Am Mon, 7 Jan 2013 22:00:40 +0000 > schrieb Tom Davie <tom.da...@gmail.com> : > >> Retain count means nothing. It may well have a retain count of 2, but be in >> the autorelease pool twice. Can you confirm that these actually are never >> released, and provide a small test case that demonstrates it? >> > > I've tried this, just before "(imps[hash])(anObject, releaseSel);": > > if([[[anObject > class]description]isEqualToString:@"GSCSubString"]){while([anObject > retainCount] > 1)[anObject release];} > > now if the GSCSubString was twice in the autorelease pools, it would have > crashed on being released by the second pool.
Would it? The behaviour when sending messages to deallocated memory is entirely undefined. It may crash, it may carry on regardless. If the memory hasn't been modified by anything else, carry on regardless is more likely. > Also I did some debugging with gdb with breakpoints on [NSAutoreleasePool > alloc] and dealloc to make sure, there are no other pools involved. And the > App is singlethreaded. Instead, simply try to reduce this to a simple test case in which the string is not deallocated, yet all autorelease pools have been popped, and all allocs/retains balanced. Thanks Tom Davie _______________________________________________ Gnustep-dev mailing list Gnustep-dev@gnu.org https://lists.gnu.org/mailman/listinfo/gnustep-dev