Help with NSURLConnection memory fault
Help with NSURLConnection memory fault
- Subject: Help with NSURLConnection memory fault
- From: Stuart Malin <email@hidden>
- Date: Wed, 14 Oct 2009 18:09:53 -0400
I create (in an object) an NSURLConnection and start it asynchronously:
mNSURLConnection = [[NSURLConnection alloc]
initWithRequest:urlRequest delegate:self];
[mNSURLConnection start];
I release the NSURLConnection instance after it calls back in
-connectionDidFinishLoading:
-connection:didFailWithError:
My code proceeds on its merry way, eventually releasing a bunch of
objects, one of which was object that created the NSURLConnection
instance (and had set itself as the delegate for that connection).
Alas, when that object is deallocated, the app crashes (since I am
running in Xcode, gdb is attached), and the stack trace shows:
#0 0xa078900c in objc_assign_ivar
#1 0x92a64558 in -[NSURLConnection(NSURLConnectionReallyInternal)
releaseDelegate]
#2 0x92a644e4 in _NSURLConnectionReleaseClient
#3 0x902cbc4d in ClientContextHolder<CFURLConnectionClient_V4>::forget
#4 0x902ca3f6 in URLConnectionClient::processEvents
...
I don't know what to make of this, other than I know that the delegate
object is already deallocated. But, the NSURLConnection object was
also, and earlier, so I don't understand why it appears to still
exist, especially so late, and is still referring to its delegate.
I'd appreciate any advice about what I should go looking after to
track this down, as I am reasonably certain that the sequence of my
object deallocations is proper (based upon NSLog() calls in the -
dealloc methods).
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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