Re: [newbie] NSString code so it won't leak
Re: [newbie] NSString code so it won't leak
- Subject: Re: [newbie] NSString code so it won't leak
- From: Shawn Erickson <email@hidden>
- Date: Thu, 12 Sep 2002 20:07:46 -0700
On Thursday, September 12, 2002, at 12:12 PM, Dean Davis wrote:
>
Oh, my. This has to be the most obtuse list I've read
>
or it's me, I think it's me so I'm done. Thanks and
>
goodbye.
I would have to agree with Dean on this folks give some recent emails...
He saw a problem that he could not explain and we saw problems in his
code that we could explain but they didn't hit the real issue. Also
many fired in with side comments and one liners about things that are
not the issue and should not have been made an issue.
We and Dean could and should have behaved a little better in our
communications.
This is an interesting issue and one I would have most likely hit in a
side project that I am working on (an no it is not because each thread
can have its own set of autorelease pools). At the moment I am not
fully sure I fully understand the problem and how best to address it.
Wrapping his inner method (URLHandleResourceDidFinishLoading) solves
the "leaking"[1] of large strings but other objects still "leak" from
what I can see. They continue to build up until the event loop gets
tickled by some event (mouse click, etc.) which his timer paired with
NRURLHandle is NOT doing. If one uses resourceDataUsingCache instead at
the NRURL level no issues exists.
I have an updated test application if people want to see this...
http://homepage.mac.com/shawnce/leaktest.dmg
I guess NSURLHandle loadInBackground changes the run loop mode such
that it doesn't result in the event loop related autorelease pool to be
cleaned.
So I want to know what is a good solution to this?
-Shawn
[1] Leak in the above is not really a leak but a build of objects in
the autorelease pool associated with the NSApp run method (the event
loop related pool).
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.