Skip navigation.
 
mlRe: Memory management/freeing with delegate methods
FROM : Paul Borokhov
DATE : Sat Apr 28 20:49:35 2007

Scott,
I crash inside XPath queries on the returned XML; I also never actually deal with the MKAsyncRequest objects in the callback methods. But maybe you're right? (the code wasn't originally written by me btw) The reason I was thinking that the [self release] is legal is because the object is initially created with an instance method that calls [super init] (not a convenience class method), and so it seems to make sense that someone needs to release it too.
Paul

----------Original Message----------
  On 4/28/07 11:19 , Scott Stevenson (<email_removed>) wrote:
>
> On Apr 28, 2007, at 10:52 AM, Paul Borokhov wrote:
>

>> My question, however, is how to do this correctly. The current code
>> will sporadically cause crashes due to dangling pointer/premature
>> release issues. Simply doing [_delegate performSelector:_selector
>> withObject:returnXML] will cause huge memory leaks.
>> So, what's the proper way of doing this? Thanks!

>
> Where are you crashing?
>
> You have "[self release]" in the  -connectionDidFinishLoading
> implementation, which seems more likely to me to be a problem than
> the returnXML object.
>
> I missed the earlier parts of this thread though, so maybe I'm
> missing your point.
>
>    - Scott

Related mailsAuthorDate
mlMemory management/freeing with delegate methods Paul Borokhov Apr 28, 19:52
mlRe: Memory management/freeing with delegate methods Scott Stevenson Apr 28, 20:19
mlRe: Memory management/freeing with delegate methods Paul Borokhov Apr 28, 20:49
mlRe: Memory management/freeing with delegate methods Buddy Kurz Apr 28, 21:34
mlRe: Memory management/freeing with delegate methods Scott Stevenson Apr 28, 22:32
mlRe: Memory management/freeing with delegate methods Paul Borokhov Apr 28, 23:01
mlRe: Memory management/freeing with delegate methods Shawn Erickson Apr 29, 00:11
mlRe: Memory management/freeing with delegate methods Matt Neuburg Apr 30, 01:52