• 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
ManagedObject Leaking and an "observation"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ManagedObject Leaking and an "observation"


  • Subject: ManagedObject Leaking and an "observation"
  • From: email@hidden
  • Date: Mon, 15 May 2006 02:17:00 -0700

Hi all,

I've just isolated a potential bug in core data, but before submitting, I want to pass it by here just to make sure I'm not doing things wrong.
I've had a problem in my app where the coredata store and all the managed objects would linger after closing a document (in a persistent doc app).
This was potentially a pretty horrendous leak but what's interesting is what causes it: observing an entity in a to-one relationship.


I narrowed it down to a super simple test app with two entities. One entity inside of awakeFromInsert creates its child, and then observes it via addObserver:forKeypath.
When this happens, the persistent store, the managed objects, everything concerning the document's coredata store is leaked until the app quits.


What I don't understand is, why, according to the docs that state that addObserver:forKeyPath neither retains the observer or the observed, yet something
here is getting over retained..... if there is something else I can do, please let me know, I haven't found the answer in the key value coding guide...


Here is the test app if anyone's interested: http://homepage.mac.com/ son_gohan/IWantAGarbageCollector.zip
In the core data model, there are just two entities. In the implementation of the parent entity, it creates a child in awake from insert.
Observing this in Object Alloc, notice when creating a new document, adding items, then closing the document, the NSManagedObjectContext etc are
still in existence, not dealloced.....


Thanks for any help.

Andre
email@hidden



_______________________________________________
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: ATSUI text in an NSView problems
  • Next by Date: Accessing SQL Databases
  • Previous by thread: Possible RBSplitView BOF at WWDC
  • Next by thread: Accessing SQL Databases
  • Index(es):
    • Date
    • Thread