On Mar 10, 2012, at 3:19 AM, jonat...@mugginsoft.com wrote: > Consider a GC app. > It is not safe to access object ivars during -finalize due to the uncertainty > which self and the ivar objects will be finalised. > > Question: > Is it safe to call objc_getAssociatedObject in -finalize or do the same > caveats apply? > I have no real idea how the collector treats such associated objects. > My guess would be that it simply collects them like any other object and that > objc_getAssociatedObject cannot be safely called in -finalize.
The same caveats apply. You can safely call objc_getAssociatedObject(), but the pointed-to objects may already have had their own -finalize methods called. -- Greg Parker gpar...@apple.com Runtime Wrangler _______________________________________________ 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