• 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
strange NSWindowController memory leak
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

strange NSWindowController memory leak


  • Subject: strange NSWindowController memory leak
  • From: Georg Tuparev <email@hidden>
  • Date: Mon, 22 Nov 2004 02:20:26 +0100

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:):

Event: (#131046) ObjectRetainedEvent
Time Index: 122777726.693979
Category: NVLogViewerWindowController
Pointer: 0x642b50 Size: 160
Thread: 0x307 Extra Data: 0x3
Backtrace:
NSRecordAllocationEvent
NSIncrementExtraRefCount
-[NSObject retain]
-[_NSBindingInfo initWithController:key:valueTransformer:binding:]
-[NSBinder addBinding:toController:withKeyPath:valueTransformer:options:]
-[NSEditableBinder addBinding:toController:withKeyPath:valueTransformer:options:]
-[NSObject(NSKeyValueBindingCreation) bind:toObject:withKeyPath:options:]
-[NSIBObjectData nibInstantiateWithOwner:topLevelObjects:]
loadNib
+[NSBundle(NSNibLoading) _loadNibFile:nameTable:withZone:ownerBundle:]
+[NSBundle(NSNibLoading) loadNibFile:externalNameTable:withZone:]
-[NSWindowController loadWindow]
-[NSWindowController window]
-[NSWindowController showWindow:]
-[NVServerMonitorWindowController showLogWindow:] NVServerMonitorWindowController.m:50
-[NSApplication sendAction:to:from:]
-[NSControl sendAction:to:]
-[NSCell _sendActionFrom:]
-[NSCell trackMouse:inRect:ofView:untilMouseUp:]
-[NSButtonCell trackMouse:inRect:ofView:untilMouseUp:]
-[NSControl mouseDown:]
-[NSWindow sendEvent:]
-[NSApplication sendEvent:]
-[NSApplication run]
NSApplicationMain
main() main.m:17
_start() crt.c:267
start


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?

TIA

Georg Tuparev
Tuparev Technologies
Klipper 13
1186 VR Amstelveen
The Netherlands
Mobile: +31-6-55798196

_______________________________________________
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: strange NSWindowController memory leak
      • From: Georg Tuparev <email@hidden>
  • Prev by Date: Re: Cocoa applications and exit codes
  • Next by Date: Re: Drag and drop file problems
  • Previous by thread: Re: Looking for NSUserDefaults example
  • Next by thread: Re: strange NSWindowController memory leak
  • Index(es):
    • Date
    • Thread