On 7/5/08 2:56 PM, Chris Hanson said: >For example, this pseudocode is wrong under GC: > > - (NSURL *)someURL { > NSURL *URL = (NSURL *)CFURLCreate...(...); > return [URL autorelease]; > } > >It will leak, because the runtime will "eat" the -autorelease message >when running under GC.
Which reminds me of something else Bill might want to watch out for: Apple's leak finding tools ('leaks', Instruments, Malloc Debug) do not work with GC apps. They report so many false positives that they are unworkable (except for Malloc Debug, which just crashes). So if your code uses malloc/new/NewPtr of whatever, you'll have a hard time finding leaks. Also, I second the recommendation to stay away from finalize. I've used it exactly twice: 1) to call DisposeHandle() to 2) to call NSLog. -- ____________________________________________________________ Sean McBride, B. Eng [EMAIL PROTECTED] Rogue Research www.rogue-research.com Mac Software Developer Montréal, Québec, Canada _______________________________________________ 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 [EMAIL PROTECTED]