>> 
>> I would think that even with a retain it could get weird...
>> 
>> The main thread wants to use the imageRef property so it calls:
>> 
>> myRef = [window.imageRef];
>> [myref retain];
>> 
>> If right between these calls, the worker thread calls setImageRef (on a
>> property with atomic, copy), then the retain call in the main thread might
>> be on something that has already gone away.
>> 
>> I just don't see how I can safely set the property on a worker thread and
>> read it on the main thread without some risk of it being released behind my
>> back.
> 
> As Graham points out, and as we used to discuss often back in the old MRR
> days, atomic getters likely put the value in the autorelease pool, you should
> go see if that’s the case or not.

How can I tell? I can't even do a retainCount without first calling the
getter.





_______________________________________________

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

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

Reply via email to