On Oct 10, 2009, at 2:25 AM, Glen Low wrote:

Not necessarily. In a pathological but presumably legit case, whatever happens in initDelegate: might only form a weak reference to the Something object, thus the Something object would be subject to GC.

That's true, although unlikely. In that case you could create an instance variable of the owning object, to point to the Something object.

Or the thread etc. could somehow fail and never call finishWithSomething: (thus leaking the Something object).

I don't think you mean "leak" there; if the thread exits, the Something object would just be collected. The Something method that runs on the thread should have an @try block around it, so that if anything goes wrong it can clean up (including calling back into your main object) before it finishes.

—Jens_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to