On Oct 8, 2009, at 7:33 PM, Glen Low wrote:

1. The code is not GC friendly as between the end of start and the beginning of finishWithSomething, there are no references to the object, so it may be collected.

There must be references to it; otherwise how would that object's methods get called later on? Either it's a delegate of another object (an NSURLConnection or NSTimer or whatever) or it starts a new thread to run one of its methods. Either way, there are references to the object that keep it alive.

2. The static analyzer in Xcode 3.2 doesn't like the construction, thinking that the object is leaking from the start method.

I'm not sure what to do about that. Casting the result to (void) might help, to explicitly state that you don't want to use the result. (Does the static analyzer even work with GC? Stating that the object is "leaking" only makes sense in a ref-counted environment.)

—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