NSTextView leaks when closing window with active edit field?
NSTextView leaks when closing window with active edit field?
- Subject: NSTextView leaks when closing window with active edit field?
- From: Jens Miltner <email@hidden>
- Date: Thu, 22 Sep 2005 10:20:39 +0200
While tracking down memory leaks in our app, I found the following
problem, which I could reproduce with a plain-vanilla document-based
Cocoa app:
When closing a window with an edit field, the NSTextView used for
doing the editing is left over.
MallocDebug doesn't flag this as a leak, so I assume there's still a
pointer to that NSTextView somewhere and may be released at app
termination time. Technically, this may not account as a leak, but
practically, memory usage will increase over time, plus the objects
may still be registered for notifications, etc., i.e. eventually
slowing down event processing, etc.
This can be reproduced fairly easily by creating a new document-based
cocoa app (using the doc-app template provided by Xcode) and adding
an edit field to the document window NIB. Then run the app with
ObjectAlloc and open and close a couple of document windows.
Switch back to ObjectAlloc and you'll see that each document window
leaves an NSTextView allocated after it's closed.
Is there anything special I need to do to get rid of this editing
NSTextView when closing the window?
Thanks,
</jum>
_______________________________________________
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