title: Help with crash log
body: <p>My app is crashing on Lion when it awakes from sleep. 
  The problem seems to be with a background thread that is looking for weather info. 
  I'm not sure but I think the crash log is telling me that the autorelease pool is popping objects that are no longer there, can someone help me confirm this?</p>
  
  <p>Here is the relevant details for the Crash log:</p>
  
  <blockquote>
    <p>Process:         myApp [14187] Identifier:      myApp Version:<br>
    ??? (???) Code Type:       X86-64 (Native) Parent Process:  launchd
    [224]</p>
    
    <p>Date/Time:       2011-08-24 18:58:00.581 -0400 OS Version:      Mac OS
    X 10.7.1 (11B26) Report Version:  9</p>
    
    <p>Crashed Thread:  7</p>
    
    <p>Exception Type:  EXC_BAD_ACCESS (SIGSEGV) Exception Codes:
    KERN_INVALID_ADDRESS at 0x0000000000000010</p>
    
    <p>Application Specific Information: objc[14187]: garbage collection is
    OFF</p>
    
    <p>Thread 7 Crashed: 0   libobjc.A.dylib<br>
      0x00007fff9321700b (anonymous
    namespace)::AutoreleasePoolPage::pop(void*) + 385 1<br>
    com.apple.CoreFoundation          0x00007fff961306a5
    <em>CFAutoreleasePoolPop + 37 2   com.apple.Foundation<br>
      0x00007fff969350d7 -[NSAutoreleasePool drain] + 154 3<br>
    com.piso13.opusDomini             0x00000001000acb91 -[Weather
    internalStart] + 417 4   com.apple.Foundation<br>
      0x00007fff9698b1ea -[NSThread main] + 68 5   com.apple.Foundation<br>
      0x00007fff9698b162 <strong>NSThread</em>_main</strong> + 1575 6   libsystem_c.dylib<br>
      0x00007fff90b068bf _pthread_start + 335 7   libsystem_c.dylib<br>
      0x00007fff90b09b75 thread_start + 13</p>
  </blockquote>
  
  <p>Here is my code for Weather Internal Start:</p>
  
  <pre><code>-(void)internalStart{
      pool = [[NSAutoreleasePool alloc] init];
  
      forecast = FALSE;
      liveweather = FALSE;
  
      NSString *query = [self generateQuery];
      if (query == nil) {
          [pool drain];
          return;
      }
  
  
      XmlWrapper * xmlWrapper = [[XmlWrapper alloc] initWithQuery:query delegate:self name:@"liveweather"];
      [xmlWrapper release];
  
      query = [self generateForecastQuery];
      xmlWrapper = [[XmlWrapper alloc] initWithQuery:query delegate:self name:@"forecast"];
      [xmlWrapper release];
  
      [pool drain];
  
  }
  </code></pre>
  
  <p>Should I even be calling [pool drain] ?</p>