<div>Ideally you should avoid this when programming Cocoa.  Retains and releases should be balanced within every method, with certain structured exceptions like accessors.  When you do it as you have here it isn't just harder for the static analyzer, it's harder for you. For example, if the framework added cancellation via new instance method and corresponding delegate callback, you'd have to update your code to avoid a leak.  </div>
<div><br></div><div>In this case, if possible, make the outstanding request a property of your object.</div><div><br></div><div>-Ken</div><div>Cocoa Frameworks</div><br><div class="gmail_quote">On Thu, Feb 25, 2010 at 9:13 AM, Steven Osborn <span dir="ltr"><<a href="mailto:osborn.steven@gmail.com">osborn.steven@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">I have a bit of code I'm calling from a Apple's StoreKit library that<br>
looks something like:<br>
<br>
<a href="http://pastebin.com/1YgyXPf9" target="_blank">http://pastebin.com/1YgyXPf9</a><br>
<br>
Where you release the object in the callback function which leads to a<br>
false positive for a memory leak.<br>
<br>
I've dug through the documentation, but I can't find anything to help<br>
me suppress this particular warning.<br>
<br>
Thanks in advance,<br>
<font color="#888888"><br>
--<br>
Steven Osborn<br>
<a href="http://steven.bitsetters.com" target="_blank">http://steven.bitsetters.com</a><br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
</font></blockquote></div><br>