title: asihttprequest crashes my app
body: <p>I have a navigation based app. Press a button on main view, then I push a new view to the navigation controller. All pretty basic stuff.</p>
  
  <p>When the new view is loaded, I do an ASIHTTPRequest to fetch some json data, which is a list of image urls.
  Then I do a for loop, create a bunch of ASIHTTPRequests, add them to a queue and then run the queue.</p>
  
  <p>But if I click on the back button before the queue is finished, the app crashes, this app displays houses and lets say you pick the wrong house, click back very quickly, before any photo is displayed, bumm crash.</p>
  
  <p>This thread <a href="http://groups.google.com/group/asihttprequest/browse_thread/thread/3d4815198aa889b9" rel="noreferrer">http://groups.google.com/group/asihttprequest/browse_thread/thread/3d4815198aa889b9</a> explains my problem real well, except I do cancel all requests on view did unload, set delegate to nil and release the queue.</p>
  
  <p>Still I crash. I crash pretty much every time if I use 3G, but on wifi it is real hard to make it crash, but quite doable.</p>
  
  <p>In almost 80% instances the debugger jumps to this line in ASIHTTPRequest.m</p>
  
  <pre><code>(void)requestReceivedResponseHeaders:(NSMutableDictionary *)newResponseHeaders { 
    if ([self error] || [self mainRequest]) { return; }  
  --&gt; if (delegate &amp;&amp; [delegate respondsToSelector:didReceiveResponseHeadersSelector]) {
  </code></pre>
  
  <p>Many many cases it jumps to :</p>
  
  <pre><code>(void)requestReceivedResponseHeaders:(NSMutableDictionary *)newResponseHeaders { 
    if ([self error] || [self mainRequest]) { return; }    
  ---&gt; if (delegate &amp;&amp; [delegate respondsToSelector:didReceiveResponseHeadersSelector]) {  
  </code></pre>
  
  <p>Ad in a handful of instances it goes to my main loop</p>
  
  <pre><code>int main(int argc, char *argv[]) {  
  NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 
  --&gt; int retVal = UIApplicationMain(argc, argv, nil, nil); with SIGBART error [pool release]; return retVal;  
  </code></pre>
  
  <p>I am using MBP and MacPro, latest OS X, Xcode 4.0.2 and I test on all apple devices except original iPhones.</p>
  
  <p>I really don't want to re-write my whole app, but is there anything else out there that compares with ASIHTTPRequest ?</p>