• 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: Two threads two autorelease pools one object?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Two threads two autorelease pools one object?


  • Subject: Re: Two threads two autorelease pools one object?
  • From: "John C. Randolph" <email@hidden>
  • Date: Wed, 2 Nov 2005 13:50:41 -0800


On Nov 2, 2005, at 12:57 PM, Brian O'Brien wrote:

 is it possible that the instance of the object exists
in two auto-release pools at the same time

This is a red herring. Threaded or not, you just have to take care to balance -retain and -release messages.


Objects don't "exist in auto-release pools", they exist in memory. An Autorelease pool is nothing more than a delayed message mechanism. Autorelease pools don't free objects, either. They send objects a -release message, and the object itself decides whether it's time to -dealloc.

If you have an object that's not going away when you expect it to, then something else has retained it, and failed to release it.

-jcr

John C. Randolph <email@hidden> (408) 914-0013
Roaming Cocoa Engineer,
Available for your projects at great Expense and Inconvenience.



_______________________________________________
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: Two threads two autorelease pools one object?
      • From: Joseph Kelly <email@hidden>
References: 
 >Two threads two autorelease pools one object? (From: "Brian O'Brien" <email@hidden>)

  • Prev by Date: Re: Margin Size Inconsistencies FYI
  • Next by Date: Crash in _gatherFocusStateInto:upTo:withContext:?
  • Previous by thread: Two threads two autorelease pools one object?
  • Next by thread: Re: Two threads two autorelease pools one object?
  • Index(es):
    • Date
    • Thread