• 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
Re: Should the analyzer catch retained objects returned from createXXX methods?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Should the analyzer catch retained objects returned from createXXX methods?


  • Subject: Re: Should the analyzer catch retained objects returned from createXXX methods?
  • From: Conrad Shultz <email@hidden>
  • Date: Wed, 17 Aug 2011 14:19:24 -0700

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 8/17/11 2:06 PM, Rick Mann wrote:
> I have a method named createFoo, from which I return an object with
> a retain count of 1. The Xc4 static analyzer is complaining about
> a potential leak, but I thought it would notice the "create" in
> the name...
>

Is there a reason it should?

Quoting from the rules:

You create an object using a method whose name begins with “alloc”,
“new”, “copy”, or “mutableCopy” (for example, alloc, newObject, or
mutableCopy).

(There are slightly different rules for Core Foundation, but you don't
indicate that this is a CF scenario.)

- --
Conrad Shultz

Synthetiq Solutions
www.synthetiqsolutions.com

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iD8DBQFOTDBcaOlrz5+0JdURAnRqAJ9AugLFMEhd/tIxMkpDZ7WvdjcCmgCghmli
YEhxiLg5lE9oGxW7F5LM7MA=
=NsXY
-----END PGP SIGNATURE-----
 _______________________________________________
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

References: 
 >Should the analyzer catch retained objects returned from createXXX methods? (From: Rick Mann <email@hidden>)

  • Prev by Date: Should the analyzer catch retained objects returned from createXXX methods?
  • Next by Date: Re: Should the analyzer catch retained objects returned from createXXX methods?
  • Previous by thread: Should the analyzer catch retained objects returned from createXXX methods?
  • Next by thread: Re: Should the analyzer catch retained objects returned from createXXX methods?
  • Index(es):
    • Date
    • Thread