title: NSURLConnection leak?
body: <p>i have set up a nsurl which grabs the data from http.
  when i run instrument, it says i have a leak NSFNetwork object. </p>
  
  <p>and how do i release <strong>theConnection</strong> in (void)ButtonClicked? or it will be release later on?</p>
  
  <pre><code>- (void)ButtonClicked {
      NSURLRequest *theRequest = [NSURLRequest requestWithURL:[NSURL URLWithString:KmlUrl]
                                                  cachePolicy:NSURLRequestUseProtocolCachePolicy
                                              timeoutInterval:20.0f];
  
      NSURLConnection *theConnection = [[NSURLConnection alloc] initWithRequest:theRequest delegate:self];
      if (theConnection) {
          // receivedData is declared as a method instance elsewhere
          NSMutableData *receivedData = [[NSMutableData data] retain];
          [self setKMLdata:receivedData];
      } else {
          // inform the user that the download could not be made
      }
  }
  
  
  - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data
  {
      // append the new data to the receivedData
      // receivedData is declared as a method instance elsewhere
      [KMLdata appendData:data];
      NSLog(@"didReceiveData");
  }
  
  
  - (void)connectionDidFinishLoading:(NSURLConnection *)connection
  {
      // release the connection, and the data object
      [connection release];
      [KMLdata release];
  }
  
  
  - (void)connection:(NSURLConnection *)connection  didFailWithError:(NSError *)error
  {
      // release the connection, and the data object
      [connection release];
      // receivedData is declared as a method instance elsewhere
      [KMLdata release];
  
  }
  </code></pre>