From 991f42ca411677696e4b70c918b8d823be3b95b6 Mon Sep 17 00:00:00 2001 From: Roland Winklmeier Date: Tue, 10 Nov 2015 14:16:17 +0100 Subject: [PATCH] Workaround xbus causing X-Plane infinite loop on OSX platforms xbus is causing an infinite loop on OSX platforms when using QApplication. Until this is fixed, default to QCoreApplication. The impact is no Qt Gui can be used inside a X-Plane plugin. So this needs to be fixed before swift gui can be bundled into one. refs #293 --- src/xbus/main.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/xbus/main.cpp b/src/xbus/main.cpp index 12a85bf79..7a7ecf0c0 100644 --- a/src/xbus/main.cpp +++ b/src/xbus/main.cpp @@ -16,7 +16,17 @@ #define XPLM_MSG_LIVERY_LOADED 108 #endif -QSharedPointer g_qApp; +// Change QSharedPointer to QSharedPointer below +// in case you want to have Qt Gui components inside a X-Plane plugin. The current +// default was used since QApplication causes an infinite loop in X-Plane on OSX +// platforms. X-Plane is allocating an NSApplication but never calling run(), rather +// it controls the main loop itself and pumps the event Q as needed. This causes +// unusual start conditions for QCocoaEventDispatcher and ends up in the infinite +// loop. Since QCoreApplication is not using QCocoaEventDispatcher it works fine +// and is used as a workaround. +// See https://dev.vatsim-germany.org/issues/293 for more information. + +QSharedPointer g_qApp; XBus::CPlugin *g_plugin; PLUGIN_API int XPluginStart(char *o_name, char *o_sig, char *o_desc)