• 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 pools in new threads
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: autorelease pools in new threads


  • Subject: Re: autorelease pools in new threads
  • From: Ondra Cada <email@hidden>
  • Date: Sat, 31 Aug 2002 03:15:59 +0200

On Saturday, August 31, 2002, at 02:59 , Chaz McGarvey wrote:

I'm having trouble with threads. I have a method (which is branched off into its own thread) that creates and AutoreleasePool as it's first statement, and it releases it as it's last. The program crashes when releasing the pool with either SIGBUS or SIGSEGV. Can anybody tell straight off with this information if I'm doing something wrong?

Sure: you add to the pool (aka autorelease) some already released object.
Or you autorelease twice. Something like

id a=[[NSArray arrayWithObjects:...] autorelease];

Then I should also say that I do not explicitly autorelease any objects while in the thread. I only have an AutoreleasePool to satisfy the fact that I do use Cocoa in the thread.

Well, then some nested call does. Or some object which is autoreleased in this thread happens to be (auto)released in another thread as well. Or something alike.

Or not, after all -- the information is not detailed enough to be completely sure. But SIGSEGV/SIGBUS at pool release means autoreleasing a released object with a *very high* probability.
---
Ondra Cada
OCSoftware: email@hidden http://www.ocs.cz
private email@hidden http://www.ocs.cz/oc
_______________________________________________
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: 
 >Re: autorelease pools in new threads (From: Chaz McGarvey <email@hidden>)

  • Prev by Date: Re: autorelease pools in new threads
  • Next by Date: Re: Tracking files the right way -- NeXT apps are less intuitive with worse HI?
  • Previous by thread: Re: autorelease pools in new threads
  • Next by thread: Re: autorelease pools in new threads
  • Index(es):
    • Date
    • Thread