I am tearing my hair out here with yet another retain issue with the 
NSAutounbinder. I don't know what I am doing to keep hitting these problems, 
and unfortunately going back through peoples past (very helpful) replies to my 
questions on both this and blocks+autorelease pools has not shed any light on 
things for me.

The situation I have is I have a sheet on a window, with the sheet containing a 
progress indicator (and time estimate). This has a window controller associated 
with it, called CocoaProgressWindow (which is also the window delegate). I 
release the window controller, and soon afterwards its retain count falls to 
zero (as it should). However, this nasty NSAutounbinder thingy then jumps in 
and re-retains it in some evil under-the-covers voodoo to do with avoiding 
retain cycles (as I understand it). Unfortunately the balancing autorelease 
only occurs 16 seconds later when I move the mouse! While not catastrophic this 
is pretty annoying and looks rather embarrassing. 

Can anybody suggest what might be happening here? I can only assume I am doing 
something wrong somewhere along the line, although I cannot imagine what it 
might be! I have recorded full callstacks of every time my retain/release is 
called:
        http://www.dur.ac.uk/j.m.taylor/complete-call-stack.txt
a version editing out the really obvious, balanced retain/releases that I know 
about:
        http://www.dur.ac.uk/j.m.taylor/call-stack-shortened.txt
and one edited down to just show the two dodgy callstacks at the end:
        http://www.dur.ac.uk/j.m.taylor/call-stack-shortened-2.txt

In general terms, I am running some demanding work (generating a movie file) on 
a GCD serial thread using dispatch_async and there is then a second nested 
dispatch_async back onto the main queue, from which I release the window 
controller. It is when that block is destroyed that the final "real" release 
occurs and the NSAutounbinder stuff happens. This is under Snow Leopard, no GC 
or ARC. It might be relevant that I am running with Mike Ash's 
ZeroingWeakReference code compiled in, although the code in question here makes 
no use of that facility whatsoever. 

Can anybody speculate what my problem might be, and how I can deal with it?
Many thanks
Jonny
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to