Retain/Release vs. bindings: Who binds to me?
Retain/Release vs. bindings: Who binds to me?
- Subject: Retain/Release vs. bindings: Who binds to me?
- From: Pierre Bernard <email@hidden>
- Date: Sat, 17 Feb 2007 15:36:42 +0100
Hi!
I am having a bug with too early deallocation.
I have a window controller which I lazily instantiate in my
NSDocument subclass. That controller loads a nib and a few other
controllers along with their views. Later I release the controller in
my Document dealloc method.
But then I get a crasher as something still tries to touch my
controller. From the stack trace below I appears that some binding is
causing this as it is undone.
#0 0x926da940 in -[_NSZombie methodSignatureForSelector:]
#1 0x925fe380 in -[NSObject(NSForwardInvocation) forward::]
#2 0x90a59cc1 in _objc_msgForward
#3 0x926c456c in _NSKeyValueObservationInfoGetForwarderForObserver
#4 0x9269c74b in -[NSObject(NSKeyValueObserverRegistration)
removeObserver:forKeyPath:]
#5 0x93521f02 in -[NSController removeObserver:forKeyPath:]
#6 0x934fd04a in -[NSBinder _updateObservingRegistration:]
#7 0x93521b92 in -[NSBinder breakConnection]
#8 0x9338d694 in +[_NSBindingAdaptor
returnDisconnectedBindingsOfObject:]
#9 0x9338d592 in -[NSTableColumn setTableView:]
#10 0x925f4059 in -[NSArray makeObjectsPerformSelector:withObject:]
#11 0x93395079 in -[NSTableView dealloc]
#12 0x93495081 in -[NSOutlineView dealloc]
#13 0x9328ba67 in -[NSView release]
#14 0x925dca0f in NSPopAutoreleasePool
#15 0x93278e28 in -[NSApplication run]
#16 0x9326cd2f in NSApplicationMain
#17 0x000f1ffc in main at main.m:13
How can I figure out who binds to my controller so I can maybe unbind
before deallocating?
Is there a standard way of debugging such memory management issues?
Thanks in advance,
Pierre
---
Pierre Bernard
http://www.bernard-web.com/pierre
http://www.houdah.com
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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