views:

26

answers:

2

Have noticed issue while testing iphone app that if one quickly opens/dismisses a modal view which contains asynchronous http calls the app eventually freezes up with a EXC_BAD_ACCESS message. I'm relatively confident that there aren't any memory leaks in either the modal view or the viewcontroller that's launching it (at least none that I can find via the leak detection tool in xcode). My newb mind wonders what happens with pending asynchronous callbacks when all of a sudden the view has been dismissed. Is this something I should be concerned about, or does the iPhone OS handle this for me?

EDIT:

Note that I'm using http://allseeing-i.com/ASIHTTPRequest and related classes for the async requests.

+1  A: 

You should retain the view controller in your HTTP request class or if you don't have an abstraction class, retain and release itself in the delegate methods.

Matt Williamson
ahhh... yep, that makes sense.
codemonkey
Accept as answer, pretty please?
Matt Williamson
lol... very likely... and prob soon.
codemonkey
@codemonkey, thanks!
Matt Williamson
+1  A: 

Additionally, have your view controller un-set itself as the delegate for pending HTTP requests in dealloc.

tc.