From e36ea3b2633c0f209dd027703bc7563b6748046e Mon Sep 17 00:00:00 2001 From: Leo Franchi Date: Fri, 8 Jun 2012 09:14:49 +0200 Subject: [PATCH] Don't use auto-release pool and manually release created NSString* --- src/libtomahawk/mac/FileHelpers.mm | 7 ++++--- src/libtomahawk/utils/TomahawkUtils_Mac.mm | 2 ++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/libtomahawk/mac/FileHelpers.mm b/src/libtomahawk/mac/FileHelpers.mm index 6757d4786..3e3c01d27 100644 --- a/src/libtomahawk/mac/FileHelpers.mm +++ b/src/libtomahawk/mac/FileHelpers.mm @@ -85,9 +85,7 @@ static BOOL AuthorizationExecuteWithPrivilegesAndWait(AuthorizationRef authoriza + (void)performMoveWithInfo:(NSDictionary *)info { - // *** GETS CALLED ON NON-MAIN THREAD! - - CAutoreleasePool _p; + // *** GETS CALLED ON NON-MAIN THREAD! NSString* fromPath = [info objectForKey: TKCopySourceKey]; NSString* toPath = [info objectForKey: TKCopyDestinationKey]; @@ -204,6 +202,9 @@ static BOOL AuthorizationExecuteWithPrivilegesAndWait(AuthorizationRef authoriza NSDictionary* dict = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:success], TKInstallerResultKey, [info objectForKey:TKInstallerDelegateKey], TKInstallerDelegateKey, error, TKInstallerErrorKey, nil]; [self notifyDelegate:dict]; + + [fromPath release]; + [toPath release]; } diff --git a/src/libtomahawk/utils/TomahawkUtils_Mac.mm b/src/libtomahawk/utils/TomahawkUtils_Mac.mm index fa82f9d76..28b03e0e3 100644 --- a/src/libtomahawk/utils/TomahawkUtils_Mac.mm +++ b/src/libtomahawk/utils/TomahawkUtils_Mac.mm @@ -61,6 +61,8 @@ if ( receiver ) QMetaObject::invokeMethod(receiver, "installSucceeded", Qt::DirectConnection, Q_ARG(QString, path)); + [target release]; + } - (void)moveFailedWithError:(NSError *)error