Re: Analyzer Questions

2010-02-02 Thread Wade Tregaskis
>> Thanks, changing several methods to use the 'new..." naming standard did >> the trick. Using create as suggested by Wade didn't fix the problem, which >> explains why another method (createBitmapContext) was showing similar >> behavior. > > Create only works with functions (CF convention).

Re: Analyzer Questions

2010-02-02 Thread Jean-Daniel Dupas
If for some reason you really want to use a naming convention that confuses the analyzer, you can also use the ns_returns_retained and cf_returns_retained clang attributes. For details about these attributes (how to use them in a way that do not conflict with GCC), have a look at the following

Re: Analyzer Questions

2010-02-02 Thread David Duncan
On Feb 2, 2010, at 1:14 PM, Bob Barnes wrote: > Thanks, changing several methods to use the 'new..." naming standard did > the trick. Using create as suggested by Wade didn't fix the problem, which > explains why another method (createBitmapContext) was showing similar > behavior. Create o

Re: Analyzer Questions

2010-02-02 Thread Bob Barnes
David, Thanks, changing several methods to use the 'new..." naming standard did the trick. Using create as suggested by Wade didn't fix the problem, which explains why another method (createBitmapContext) was showing similar behavior. Bob On Feb 2, 2010, at 12:18 PM, David Duncan wrote:

Re: Analyzer Questions

2010-02-02 Thread Wade Tregaskis
> - (CGPDFDocumentRef)getPDFDocumentRef:(const char *)filename { > CGPDFDocumentRefdocument; > >snip... > > document = CGPDFDocumentCreateWithURL(url); > return document; > } The CF convention is that functions and methods that return a literal reference t

Re: Analyzer Questions

2010-02-02 Thread David Duncan
On Feb 2, 2010, at 11:58 AM, Bob Barnes wrote: > I've recently upgraded to Mac OS X 10.6.2 in order to run the Analyzer for > Xcode and it's pointing out some potential memory leaks that really have me > confused. A typical example is where I have a method that allocates and > returns somethi

Analyzer Questions

2010-02-02 Thread Bob Barnes
Hi all, I've recently upgraded to Mac OS X 10.6.2 in order to run the Analyzer for Xcode and it's pointing out some potential memory leaks that really have me confused. A typical example is where I have a method that allocates and returns something like a CGPDFDocumentRef or CGContextRef. Th