Re: Still can't figure out this overrelease bug
Re: Still can't figure out this overrelease bug
- Subject: Re: Still can't figure out this overrelease bug
- From: "Theodore H. Smith" <email@hidden>
- Date: Sat, 11 Jun 2005 13:30:53 +0100
OK, well hows about this. If I use NSAutoReleasePool well enough,
maybe I can pin this bug down?
I've never done this before, though, it just seems like it might be
possible, from what I read. I'm not exactly sure yet on what
additional bugs I might create by (badly) using NSAutoReleasePool.
Let's say I had this code:
NSAutoReleasePool* p = [[NSAutoReleasePool alloc]init];
NSString* s = [NSString stringWithCString : "hello"];
[p drain];
[self doStuffWith : s]; // crash.
[p release]; // we never get here
Something like that would a bug introduced by badly using
NSAutoReleasePool, right?
Then the problem becomes finding out which references to NSObjects I
have for which lifetimes.
Let's (very theoretically) say then that I am able to perfectly
figure out the lifetime of every NSObject I have.
NSAutoReleasePool* p = [[NSAutoReleasePool alloc]init];
NSString* s = [NSString stringWithCString : "hello"];
[s autorelease]; // over released!
[self doStuffWith : s];
[p drain]; // crash.
[p release];
Would that then help me pin down my bug, by making the crash closer
to the point where I overrelease?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden