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:
parent
015bc9d7ce
commit
536c5df13f
@ -131,8 +131,8 @@ QT_END_NAMESPACE
|
||||
@synchronized(self) {
|
||||
if (sharedCocoaApplicationDelegate == nil) {
|
||||
sharedCocoaApplicationDelegate = [super allocWithZone:zone];
|
||||
return sharedCocoaApplicationDelegate;
|
||||
qAddPostRoutine(cleanupCocoaApplicationDelegate);
|
||||
return sharedCocoaApplicationDelegate;
|
||||
}
|
||||
}
|
||||
return nil;
|
||||
|
Loading…
Reference in New Issue
Block a user