• 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
Window controller dealloc never called
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Window controller dealloc never called


  • Subject: Window controller dealloc never called
  • From: Ken Tozier <email@hidden>
  • Date: Tue, 29 Aug 2006 03:17:16 -0400

Hi

During development of a Quark plugin, I came up with a way to load my window and dialog nibs which works but now that I'm approaching delivery, I need a way to make sure that the windows I open are released. In tests, none of the windows and dialogs ever get released which is, I suspect, causing a huge memory leak.

Due to the fact that Quark XTensions are located in a folder outside of the Quark application bundle, the nib loading problem is a bit unique. I can't use [[NSBundle mainbundle] pathForResource:ofType:] or either of NSWindowController's "initWithWindowNibName:" or "initWithWindowNibName:owner:" methods from within the plugin because it only gives me access to the Quark bundle and that's not where my nibs are located.

What I ended up doing is creating my own bundle loader and nib location code and feeding the resultant paths to NSWindowController's initWithWindowNibPath:owner: method. Here's a typical window init method for my various dialogs

- (id) initWithPlugin:(XTPlugin *) inPlugin
{
NSString *path = [[inPlugin bundle] pathForResource: @"PaginationTools" ofType: @"nib"];
if (self = [super initWithWindowNibPath: path owner: self])
{
/* window specific init code here */
}

return self;
}


While this works well enough for development, I suspect that the "(self = [super initWithWindowNibPath: path owner: self])" line is causing an infinite loop on window dealloc as the owner of the thing that is being dealloc'd is the thing itself. Since I'm forced into using initWithWindowNibPath, is there any other way I can do this that will absolutely guarantee window dealloc?

Thanks in advance

Ken
_______________________________________________
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


  • Follow-Ups:
    • Re: Window controller dealloc never called
      • From: Ken Tozier <email@hidden>
  • Prev by Date: Re: getting bytes from NSData appends some special characters at the end
  • Next by Date: Re: NSDatePickerCell -- Ever Worked ??
  • Previous by thread: Re: Escaping a Degree Symbol
  • Next by thread: Re: Window controller dealloc never called
  • Index(es):
    • Date
    • Thread