• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Singletons cause static analyzer warning
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Singletons cause static analyzer warning


  • Subject: Singletons cause static analyzer warning
  • From: Sidney San Martín <email@hidden>
  • Date: Thu, 10 Sep 2009 15:49:43 -0400

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

  • Follow-Ups:
    • Re: Singletons cause static analyzer warning
      • From: Chris Suter <email@hidden>
    • Re: Singletons cause static analyzer warning
      • From: Brad Goss <email@hidden>
    • Re: Singletons cause static analyzer warning
      • From: Alexander von Below <email@hidden>
  • Prev by Date: Re: clang-llvm: Tracking core OS crashes (Found! It's the 10.4 SDK)
  • Next by Date: Re: Singletons cause static analyzer warning
  • Previous by thread: Re: XC & IB 3.2 - overlapping sibilings
  • Next by thread: Re: Singletons cause static analyzer warning
  • Index(es):
    • Date
    • Thread