On Fri, Jun 26, 2009 at 2:31 PM, James Gregurich<[email protected]> wrote: > > If my resource is handed off to some external subsystem for release and I > can't DETERMINE the order of the releases with respect to each other and > other components of my code, then I would call that non-deterministic and > undesirable.
If nondeterministic memory deallocation is a dealbreaker for you, then Cocoa is not for you, pure and simple. You cannot predict when your objects will be destroyed in Cocoa. Garbage collection is irrelevant to this fact, and changes nothing about it except the degree. Even a simple alloc/init/release pair is not guaranteed to destroy the object on the release. The init method could store a strong reference away somewhere, or do a retain/autorelease combo, or pass a reference off to another thread, and now you're screwed. All GC does is make it happen more often. You *never* could rely on object lifetimes. If your non-GC code relies on precisely controlling object lifetimes, then you have a bug, and should fix it. Mike _______________________________________________ Cocoa-dev mailing list ([email protected]) 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 [email protected]
