Re: Need advice: Object ownership and threading issue, causing a rare crash.
Re: Need advice: Object ownership and threading issue, causing a rare crash.
- Subject: Re: Need advice: Object ownership and threading issue, causing a rare crash.
- From: Jens Alfke <email@hidden>
- Date: Thu, 02 May 2013 09:53:54 -0700
On May 1, 2013, at 5:10 AM, Motti Shneor <email@hidden> wrote:
> Currently, MyB retains itself within its thread, and releases itself just before the thread exits. I know it is bad practice (self retaining objects), but I did not yet think of a better way.
>
> This way, when the owner releases its MyB and replaces its reference with a new MyB object, the MyB is just released once, and does not get deallocated. When its thread finishes its cycle in the background, the thread function releases the objects again, and returns.
That's fine, IMHO, and I've both read and written code that does this.
—Jens
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden