• 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: Cocoa-dev Digest, Vol 1, Issue 311
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cocoa-dev Digest, Vol 1, Issue 311


  • Subject: Re: Cocoa-dev Digest, Vol 1, Issue 311
  • From: Alun ap Rhisiart <email@hidden>
  • Date: Mon, 22 Nov 2004 09:42:40 +0000



On 22 Nov 2004, at 02:24, email@hidden wrote:

Date: Mon, 22 Nov 2004 02:20:26 +0100
From: Georg Tuparev <email@hidden>
Subject: strange NSWindowController memory leak
To: Cocoa Dev <email@hidden>
[snip]
Folks,

I discovered a NSWindowController (non document based application) that
leaks badly - to be more precise retain count is 10 instead of 1. When
looking at this with ObjectAlloc I found following suspiciously looking
retain events (all retains took place during Window Controller's
showWindow method called immediately after initWithWindowNibName:):

[snip]
This looks like the buggy binding memory management discussed on this
forum few months ago. Well, there are no NSControllers in this nib. But
I remember that in a very early version, we were using
NSArrayController bound to a NSPopUpButton.

Q1. Is it possible that although we do not use binding in this nib, the
binding leak is still present after removing both NSArrayController and
the NSPopUpButton?

Q2. If the answer of my first question is yes, how can I clean the mess
without redoing the entire nib?
This looks exactly like the situation I am in, although it is causing me more problems than memory leaks. In my (first) Cocoa app I have used bindings extensively. However, I had problems because of a binding calling a method that shouldn't have been called anymore. Problem was I couldn't find where this binding was in the nib. So I recreated the nib file manually. Everything was then fine, but now I find that after saving, when I try to reopen a document it fails in various ways. My log says that something about unable to find the 'locked' selector. There used to be a locked attribute, and a checkbox with a binding to it, but I removed them some time ago. Other times when reading the file I get type errors such as Cannot create NSArray from object NSFileSpecifier:... of class NSFileSpecifier. However, I am not storing any FileSpecifiers, and this happens after my document loadDataRepresentation:ofType: method finishes. Again, I think this is all old bindings coming back and playing havoc. I haven't found a way of dealing with this, or even adequately debugging it, other than starting from scratch with a new nib file (not even copying controls from the first one). I would be very interested in any other answers from more experienced cocoa developers.
Alun ap Rhisiart



_______________________________________________ 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
  • Prev by Date: Re: tile-based game sample code?
  • Next by Date: Re: How to disable/gray an NSTextfield (used as static text)
  • Previous by thread: Re: mouse location across multiple monitors
  • Next by thread: Buttons with images in NSTableView
  • Index(es):
    • Date
    • Thread