Re: Singletons cause static analyzer warning
Re: Singletons cause static analyzer warning
- Subject: Re: Singletons cause static analyzer warning
- From: Brad Goss <email@hidden>
- Date: Thu, 10 Sep 2009 15:56:20 -0400
I simple autorelease it. This won't cause any harm as you've
overridden the autorelease method to do nothing.
[[[self alloc] init] autorelease]
Brad Goss
email@hidden
On 2009-09-10, at 15:49 , Sidney San Martín wrote:
If I implement a singleton as described in the docs
(<http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/CocoaFundamentals/CocoaObjects/CocoaObjects.html#//apple_ref/doc/uid/TP40002974-CH4-SW32
>),
Xcode 3.2's static analyzer throws a warning:
MyGizmoClass.m:19:13: warning: Potential leak of an object allocated
on line 19
[[self alloc] init]; // assignment not done here
^
Is the analyzer behaving correctly here? How can I placate it?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden