After fixing things so that my NSWindowController subclass gets deallocated, I discovered that the NSWindow was not getting deallocated. It appears to be related to the fact that the NSWindow's retain count is incremented each time -[NSWindowController window] is called. I don't see anything in the documentation of the window method that would have led me to expect that behavior. Is there some general principle I should know about?

For now, I've worked around the problem by overriding the window method as follows, where mWindow is a member variable:

- (NSWindow *)window
{
        if (mWindow == nil)
        {
                mWindow = [super window];
        }
        
        return mWindow;
}

--
  James W. Walker, Innoventive Software LLC
  <http://www.frameforge3d.com/>
_______________________________________________

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

This email sent to [EMAIL PROTECTED]

Reply via email to