Re: NSDocument leak with top-of-NIB object controllers (10.6 ARC)
Re: NSDocument leak with top-of-NIB object controllers (10.6 ARC)
- Subject: Re: NSDocument leak with top-of-NIB object controllers (10.6 ARC)
- From: Fritz Anderson <email@hidden>
- Date: Thu, 22 Dec 2011 16:44:09 -0600
On 22 Dec 2011, at 4:02 PM, Fritz Anderson wrote:
> Maybe I have to have another look at that horrific little ARC dance. If that's necessary, then I was wrong to declare the object-controller outlets u_u, they should be strong, and I should then do the HLAD.
HLAD was harmful — passing the top-level objects to CFRelease() to relieve the "extra" retention resulted in an overrelease. So now what I'm doing is:
- Declare the property holding the top-level object strong.
- Manually nil-out the property at windowWillClose: time. If I don't do this, the objects' references back to the NSDocument (they are NSControllers bound to model objects through the document) will produce a retain loop so the document will never be dealloced.
This leads me to believe that a 10.6-targeted ARC application, running on 10.7, will _not_ see +1 retained top-level objects.
Which leads me once again to wonder what happens on 10.6. Do the NSControllers get overretained? If so, is there a way to detect the different loading behavior and do an extra release accordingly?
I'm beginning to sense ARC + Mac + NIBs + 10.6 is a corner case that wasn't fully thought out.
— F
_______________________________________________
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