From 536c5df13f20ef7fe838f2f60cbaf075f8dc212e Mon Sep 17 00:00:00 2001 From: Tim Blechmann Date: Sat, 13 Dec 2014 20:21:38 +0100 Subject: Cocoa: QCocoaApplicationDelegate - correctly install cleanup handler MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit + (id)allocWithZone:(NSZone *)zone returns before the cleanup handler is installed. this causes the QCocoaApplicationDelegate not to be cleaned up by the garbage collector Change-Id: Ic4862b96228539f3da857955f08157402974a104 Reviewed-by: Morten Johan Sørvig --- src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm b/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm index f3a0216870..6c673a4f5d 100644 --- a/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm +++ b/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm @@ -131,8 +131,8 @@ QT_END_NAMESPACE @synchronized(self) { if (sharedCocoaApplicationDelegate == nil) { sharedCocoaApplicationDelegate = [super allocWithZone:zone]; - return sharedCocoaApplicationDelegate; qAddPostRoutine(cleanupCocoaApplicationDelegate); + return sharedCocoaApplicationDelegate; } } return nil; -- cgit v1.2.3