• 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: Autorelease problem with NSKeyedUnarchive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Autorelease problem with NSKeyedUnarchive


  • Subject: Re: Autorelease problem with NSKeyedUnarchive
  • From: Scott Anguish <email@hidden>
  • Date: Thu, 21 Aug 2003 04:14:25 -0400

This is because the returned result is autoreleased, and so unless you retain it, you stand the chance of losing it. You're releasing it when you didn't retain it, so when the autorelease pool tries to release it again, the world collapses in upon itself and all life as we know it ceases to exist.

It fits the category of "you didn't explicitly alloc/init it, so you must retain"...


On Thursday, August 21, 2003, at 3:31 AM, Michael S|ssner wrote:

I have written a small test tool archiving and unarchiving a customized
subclass of NSObject.

Each time
vData = [NSKeyedUnarchiver
unarchiveObjectWithFile:@"/tmp/jwtestarchive"];

...
[vData release];

It seems to workout fine but when the Autorelease pool is finally released,
the tool crashes within the release method of the autolease class.

If I retain the vData object, then I do not run into a memory BAD_ACCESS. I
have studied the release documents and could not find any hint.


Any help?
Michael
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Autorelease problem with NSKeyedUnarchive (From: Michael Süssner <email@hidden>)

  • Prev by Date: State of threads in crash log
  • Next by Date: Diff-ing two executables?
  • Previous by thread: Autorelease problem with NSKeyedUnarchive
  • Next by thread: Re: Autorelease problem with NSKeyedUnarchive
  • Index(es):
    • Date
    • Thread