I hate it when Thunderbird manages to throw away the content of the mails I send to the list! Let's try again...
Il giorno 12/set/2013, alle ore 11:35, Graham Cox <graham....@bigpond.com> ha scritto: > Here's some code for which the Analyser reports "potential leak of an object > stored into 'eventTypes'". I don't see it. > > I didn't write this code, so I'm reluctant to change it even though I would > have written it a bit differently. mEventTypes is an ivar. > > - (void)setEventTypes:(NSDictionary*)eventTypes > { > if (eventTypes != mEventTypes) > { > [mEventTypes release]; > mEventTypes = [eventTypes retain]; > } > InitializePrefsForEventTypeNames(); > } > > - (NSDictionary*)eventTypes > { > if (mEventTypes == nil) > { > [self loadNib]; > > NSDictionary* eventTypes = [self newEventTypes]; > [self setEventTypes:eventTypes]; > [eventTypes release]; > } > > return mEventTypes; //<----- analyser complains here > } > is there a [mEventTypes release] in -dealloc? Otherwise, this might be the "potential" problem it complains about: -eventTypes can create a new object which never goes away (since its name doesn't imply a +1 return, the caller is not supposed to release it). -- Simone Tellini http://tellini.info/ _______________________________________________ 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