• 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
NSTextView leaks when closing window with active edit field?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Not attaching Mail.App plug-in
  • Next by Date: NSTextView Custom Insertion Point
  • Previous by thread: Fwd: Not attaching Mail.App plug-in
  • Next by thread: NSTextView Custom Insertion Point
  • Index(es):
    • Date
    • Thread