title: Memory leak at Autorelease pool in Iphone sdk
body: <p>I am getting leak at [pool release];</p>
  
  <p>My code here is:</p>
  
  <pre><code>#pragma mark UISearchBarDelegate delegate methods
  
  
  - (void)performSearch:(UISearchBar *)aSearchBar
  {
  
  NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
  
  artistName= [aSearchBar.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
  if ([artistName length] &gt; 0) 
  {
  
      [UIApplication sharedApplication].networkActivityIndicatorVisible = YES;
  
      LyricsAppDelegate* appDelegate =  (LyricsAppDelegate*) [ [UIApplication sharedApplication] delegate];
      artistsList=[appDelegate doSearch:artistName ];
      [theTableView reloadData];
      [UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
  
  
      [UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
  
  
      [aSearchBar resignFirstResponder];
  }
  else
  {
      [aSearchBar resignFirstResponder];
  }
  [NSThread exit];
  [pool release]; 
  
  }
  
  - (void)searchBarSearchButtonClicked:(UISearchBar *)aSearchBar
  {
  @try {
      [NSThread detachNewThreadSelector:@selector(performSearch:) toTarget:self withObject:aSearchBar];
      [aSearchBar resignFirstResponder];
  }
  @catch (NSException * e) {
      NSLog(@"\n caught an exception");
  }
  @finally {
  }
  }
  </code></pre>
  
  <p>Here I am getting leak at [pool release]; in performSearch method.</p>
  
  <p>How can I solve this.</p>
  
  <p>Anyone's help will be much appreciated.</p>
  
  <p>Thank you,
  Monish.</p>