]> git.sesse.net Git - vlc/commitdiff
macosx: Make sure we cancel the crashLogURLConnection at exit.
authorPierre d'Herbemont <pdherbemont@videolan.org>
Fri, 15 Aug 2008 19:39:02 +0000 (21:39 +0200)
committerPierre d'Herbemont <pdherbemont@videolan.org>
Fri, 15 Aug 2008 22:21:12 +0000 (00:21 +0200)
modules/gui/macosx/intf.h
modules/gui/macosx/intf.m

index 4c707254e8c84c5801a6dc2ba4aad66ea5ca8244..ded1405908acc4d727f81134500dd12fe210d3c0 100644 (file)
@@ -320,6 +320,8 @@ struct intf_sys_t
     /* The timer that update the interface */
     NSTimer * interfaceTimer;
 
+    NSURLConnection * crashLogURLConnection;
+
     AppleRemote * o_remote;
     BOOL b_remote_button_hold; /* true as long as the user holds the left,right,plus or minus on the remote control */
 }
index 7a7ee7d8fbe597ad5ff94b9f443b304bf18d79da..ca3b0f4c23e4d76406d114e3f58a044e2df5c5b4 100644 (file)
@@ -1870,6 +1870,9 @@ end:
 
     if( nib_wizard_loaded )
         [o_wizard release];
+
+    [crashLogURLConnection cancel];
+    [crashLogURLConnection release];
  
     [o_embedded_list release];
     [o_interaction_list release];
@@ -2127,7 +2130,7 @@ end:
     [req setHTTPBody:[postBody dataUsingEncoding:NSUTF8StringEncoding]];
 
     /* Released from delegate */
-    NSURLConnection *theConnection = [[NSURLConnection alloc] initWithRequest:req delegate:self];
+    crashLogURLConnection = [[NSURLConnection alloc] initWithRequest:req delegate:self];
 }
 
 - (void)connectionDidFinishLoading:(NSURLConnection *)connection
@@ -2135,13 +2138,15 @@ end:
     NSRunInformationalAlertPanel(_NS("Crash Report successfully sent"),
                 _NS("Thanks for your report!"),
                 _NS("OK"), nil, nil, nil);
-    [connection release];
+    [crashLogURLConnection release];
+    crashLogURLConnection = nil;
 }
 
 - (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error
 {
     NSRunCriticalAlertPanel(_NS("Error when sending the Crash Report"), [error localizedDescription], @"OK", nil, nil);
-    [connection release];
+    [crashLogURLConnection release];
+    crashLogURLConnection = nil;
 }
 
 - (NSString *)latestCrashLogPathPreviouslySeen:(BOOL)previouslySeen