From 55de54d44dcdc186e0ed475b8247dff4801d7a17 Mon Sep 17 00:00:00 2001 From: Pierre d'Herbemont Date: Fri, 15 Aug 2008 21:39:02 +0200 Subject: [PATCH] macosx: Make sure we cancel the crashLogURLConnection at exit. --- modules/gui/macosx/intf.h | 2 ++ modules/gui/macosx/intf.m | 11 ++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/modules/gui/macosx/intf.h b/modules/gui/macosx/intf.h index 4c707254e8..ded1405908 100644 --- a/modules/gui/macosx/intf.h +++ b/modules/gui/macosx/intf.h @@ -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 */ } diff --git a/modules/gui/macosx/intf.m b/modules/gui/macosx/intf.m index 7a7ee7d8fb..ca3b0f4c23 100644 --- a/modules/gui/macosx/intf.m +++ b/modules/gui/macosx/intf.m @@ -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 -- 2.39.2