Document-WindowController release misorder
Document-WindowController release misorder
- Subject: Document-WindowController release misorder
- From: Edwin Vane <email@hidden>
- Date: Wed, 17 Aug 2005 23:35:27 -0400
- Mail-followup-to: Cocoa-Dev <email@hidden>
Hi,
I have an application where my document has a single window and so I use
windowNibName to provide the name of the nib and Cocoa does the rest
internally.
In preperation for moving to multiple views, I subclassed the window
controller to control the main window. I also overrode
makeWindowControllers like the following:
TimeLineWC *timeLineWC = [[TimeLineWC alloc] init];
[self addWindowController: timeLineWC];
[timeLineWC setShouldCloseDocument:YES];
[timeLineWC release];
There also used to be bindings from an array controller in the nib to
the old file's owner (the document). I've changed this now to go through
the document property of the new file's owner (the custom window
controller).
So with only these basic changes, I'm finding that when the window
closes now, the document gets deallocated before the views do (which
produces warnings about deallocating objects while they're being
observed). Even worse, the views don't appear to be deallocated. When I
adjust the nib to turn off the binding through the file owner, the
document still gets released first but at least the views are being
released now. I'm aware of the problems of binding through the file's
owner but as far as I know, this only causes leaks, not premature
deallocations.
As far as I know I was following all the directions/examples but clearly
I've missed some important detail somewhere. My guess is the window
controller is being retained by something somewhere. Any ideas what
might be causing the problem?
--
Edwin Vane
MMath Candidate
Computer Graphics Lab
School of Computer Science
University of Waterloo
_______________________________________________
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