Re: NSTextView won't deallocate
Re: NSTextView won't deallocate
- Subject: Re: NSTextView won't deallocate
- From: Vincent Habchi <email@hidden>
- Date: Mon, 18 Jul 2011 16:16:50 +0200
Le 18 juil. 2011 à 15:26, Ryan Joseph a écrit :
> I literally mean that _exact_ snippet is leaking, 2 lines of code with no retaining by any superviews. I only have limited experience with Cocoa and don't use Objective C so maybe someone else could test this. Just allocate, initialize then release the object and see if it's ever deallocated. Impossible that would happen right?
I wonder if that not using ObjC is of importance. When an object is initially created, it may be retained several times by Cocoa guts routines, just to insure that it will not be destroyed before the initializations are done. That's typically what you are registering with retain count = 5. However, once this transient condition ends, everything turns back normal and your retain count should reach 0.
If you want to dive deeper, try overriding -retain and -release just by calling super, put a breakpoint here, and examine the calls and how they are balanced. Or use the allocations instruments to trace what's going on.
Vincent_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden