Cocoa: QCocoaApplicationDelegate - correctly install cleanup handler

+ (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 <morten.sorvig@theqtcompany.com>
This commit is contained in:
Tim Blechmann 2014-12-13 20:21:38 +01:00 committed by Jørgen Lind
parent 015bc9d7ce
commit 536c5df13f

View File

@ -131,8 +131,8 @@ QT_END_NAMESPACE
@synchronized(self) {
if (sharedCocoaApplicationDelegate == nil) {
sharedCocoaApplicationDelegate = [super allocWithZone:zone];
return sharedCocoaApplicationDelegate;
qAddPostRoutine(cleanupCocoaApplicationDelegate);
return sharedCocoaApplicationDelegate;
}
}
return nil;