Re: NSURLConnection leaking on multi-threaded apps?
Re: NSURLConnection leaking on multi-threaded apps?
- Subject: Re: NSURLConnection leaking on multi-threaded apps?
- From: Matt Neuburg <email@hidden>
- Date: Sun, 11 Mar 2007 09:12:08 -0700
- Thread-topic: NSURLConnection leaking on multi-threaded apps?
On Sun, 4 Mar 2007 15:51:06 -0800, Paul Borokhov <email@hidden> said:
> So, as a follow-up to my previous threads discussion, which I do want to keep
> on-topic, it appears that NSURLConnection leaks whenever it's called inside a
> method that's been detached from the main thread. Namely, I tested my
> application with threading and without, and the thread-less version has no
> leaks. Just to reiterate, I never actually call the NSURLConnection methods
> directly, I DO have autorelease pools set up properly, and there is NOTHING
> else that is leaking (apart from the NSUC-associated classes), even though I
> do create (and manage to properly discard) a lot of other data, including XML
> documents, strings, etc. I'm guessing that the reason NSURLConnection gets
> called at all is because I call NSXMLDocument
> initWithContentsOfURL:options:error: to get data, and that method uses
> NSURLConnection internally?
This sounds like a variant of the NSURLConnection bug that causes a sporadic
crash when loading Core Data data from an XML store. The
NSPersistentStoreCoordinator calls NSXMLDocument
initWithContentsOfURL:options:error: which calls NSURLConnection and things
rapidly go south because of threading (and it's all Apple's code, so doing
something about it is quite tricky).
So, to sum up, yes, it's known that there are memory-management problems
with NSURLConnection and threads, and Apple's own code falls prey to these
problems. m.
--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
<http://www.amazon.com/gp/product/0596102119>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden