From aebb767cfb3d15d5a2d2e583f413299915dff84f Mon Sep 17 00:00:00 2001 From: Erik Aderstedt Date: Fri, 10 Aug 2012 12:29:38 +0200 Subject: [PATCH] Cancel download no longer crashes the app. --- Downloading XPC Service/SUXPCURLDownload.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Downloading XPC Service/SUXPCURLDownload.m b/Downloading XPC Service/SUXPCURLDownload.m index d5768f36..093bb340 100644 --- a/Downloading XPC Service/SUXPCURLDownload.m +++ b/Downloading XPC Service/SUXPCURLDownload.m @@ -94,7 +94,6 @@ - (void)cancel { xpc_connection_cancel(connection); - xpc_release(connection); } - (xpc_connection_t)getSandboxXPCService { @@ -123,7 +122,8 @@ // xpc_connection_create() is incorrect or we (this process) have // canceled the service; we can do any cleanup of appliation // state at this point. - xpc_release(connection); + xpc_connection_cancel(delegateConnection); + xpc_release(delegateConnection); } } });