summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qcocoaapplicationdelegate_mac.mm
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@digia.com>2009-08-21 15:56:57 +0300
committerMiikka Heikkinen <miikka.heikkinen@digia.com>2009-08-21 15:56:57 +0300
commit34679dd23213881a9632e21e4858377ff90a9006 (patch)
treedeb9ebf681d4954b2d44858ca1a14d251c31e8eb /src/gui/kernel/qcocoaapplicationdelegate_mac.mm
parent7669f91c33328505fbe52f4913bd3f8745b76d31 (diff)
parent4aa6869877d4906fcfaac5388294748512cace25 (diff)
Merge branch 'master' of git@scm.dev.troll.no:qt/qt-s60-public
Conflicts: src/corelib/io/qfilesystemwatcher_symbian.cpp src/corelib/io/qfilesystemwatcher_symbian_p.h
Diffstat (limited to 'src/gui/kernel/qcocoaapplicationdelegate_mac.mm')
-rw-r--r--src/gui/kernel/qcocoaapplicationdelegate_mac.mm18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/gui/kernel/qcocoaapplicationdelegate_mac.mm b/src/gui/kernel/qcocoaapplicationdelegate_mac.mm
index 572df705f..172d07b7c 100644
--- a/src/gui/kernel/qcocoaapplicationdelegate_mac.mm
+++ b/src/gui/kernel/qcocoaapplicationdelegate_mac.mm
@@ -197,11 +197,19 @@ static void cleanupCocoaApplicationDelegate()
}
}
- // Prevent Cocoa from terminating the application, since this simply
- // exits the program whithout allowing QApplication::exec() to return.
- // The call to QApplication::quit() above will instead quit the
- // application from the Qt side.
- return NSTerminateCancel;
+ if (qtPrivate->threadData->eventLoops.size() == 0) {
+ // INVARIANT: No event loop is executing. This probably
+ // means that Qt is used as a plugin, or as a part of a native
+ // Cocoa application. In any case it should be fine to
+ // terminate now:
+ return NSTerminateNow;
+ } else {
+ // Prevent Cocoa from terminating the application, since this simply
+ // exits the program whithout allowing QApplication::exec() to return.
+ // The call to QApplication::quit() above will instead quit the
+ // application from the Qt side.
+ return NSTerminateCancel;
+ }
}
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification