• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Window Controller not being released.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Window Controller not being released.


  • Subject: Re: Window Controller not being released.
  • From: Dustin Voss <email@hidden>
  • Date: Tue, 22 Oct 2002 20:52:00 -0700

On Tuesday, October 22, 2002, at 09:25 AM, Josh Ferguson wrote:

I'm having some troubles with my document based app not releasing the window controller. I've watched the retain and release calls to see what objects are retaining the controller, but unfortunately, I can't match up each call to release with each call to retain to tell which retain isn't getting released. Basically, here's what's happening:

1.) in the Document's makeWindowController method, I allocate the controller ([[controller alloc] initWithNibName]) which sends a retain request
2.) I call [document addWindowController]
3.) I manually release the window controller from step 1
4.) in the image controller, I set up a connection between two threads, which retains/releases 5/6 times
5.) after closing the window, the window sends a few retain/release calls

and I'm left with a retain count of 1 (and a seriously leaky program). Do I need to manually remove the controller from the document? I've noticed that when the document's dealloc method is called, the windowController array is empty (so I would assume it's automatically getting removed). If I do need to call removeWindowController:, where should I do that? I'm also wary of the NSConnection that I create. Do I need to "close" the connection or anything before I deallocate it? Anybody have any recommendations?

I can tell you that you don't need to worry about NSConnection. That class is only used during NIB loading, and the AppKit releases them when done.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
References: 
 >Window Controller not being released. (From: "Josh Ferguson" <email@hidden>)

  • Prev by Date: Help: while(;;) loop vs. NSTimer / NSThread
  • Next by Date: Re: retrieving your IP address
  • Previous by thread: Window Controller not being released.
  • Next by thread: RE: Window Controller not being released.
  • Index(es):
    • Date
    • Thread