• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
[SOLVED] Re: Help with NSURLConnection memory fault
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SOLVED] Re: Help with NSURLConnection memory fault


  • Subject: [SOLVED] Re: Help with NSURLConnection memory fault
  • From: Stuart Malin <email@hidden>
  • Date: Wed, 14 Oct 2009 22:43:20 -0400


On Oct 14, 2009, at 7:24 PM, Jens Alfke wrote:

It looks as though your object (the delegate) got dealloced too early, before the NSURLConnection finished loading. This shouldn't be possible, since the connection object retains the delegate, but you may have too many release calls to it someplace.

What I would do next is set a breakpoint in your class's dealloc method, and also in its -connectionDidFinishLoading: and - connection:didFailWithError:, and see which gets called first.

Thanks for the reply, Jens. As I suspected, the time sequence ordering of the releases was just fine. The problem was releasing the NSURLConnection object twice, once when the connection had concluded, and again when the object that had created it was dealloc'ing (because I hadn't nil'd the pointer to the connection object after releasing it). Just a "lucky" coincidence that the memory where the dealloc'd NSURLConnection had lived was still the (now defunct) object, so it went through its motions again, and tried to release the delegate a second time.




_______________________________________________

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


  • Follow-Ups:
    • Re: [SOLVED] Re: Help with NSURLConnection memory fault
      • From: Jens Alfke <email@hidden>
References: 
 >Help with NSURLConnection memory fault (From: Stuart Malin <email@hidden>)
 >Re: Help with NSURLConnection memory fault (From: Jens Alfke <email@hidden>)

  • Prev by Date: Re: Property List Format vs NSKeyedArchiver Format
  • Next by Date: Re: iPhone/iPod Device Detection Necessary for App Approval?
  • Previous by thread: Re: Help with NSURLConnection memory fault
  • Next by thread: Re: [SOLVED] Re: Help with NSURLConnection memory fault
  • Index(es):
    • Date
    • Thread