summaryrefslogtreecommitdiff
path: root/vcl/qt5/QtInstance.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/qt5/QtInstance.cxx')
-rw-r--r--vcl/qt5/QtInstance.cxx11
1 files changed, 11 insertions, 0 deletions
diff --git a/vcl/qt5/QtInstance.cxx b/vcl/qt5/QtInstance.cxx
index 6872fb0fe1a3..dfcf0c2c4f08 100644
--- a/vcl/qt5/QtInstance.cxx
+++ b/vcl/qt5/QtInstance.cxx
@@ -55,6 +55,7 @@
#include <vcl/stdtext.hxx>
#include <vcl/sysdata.hxx>
#include <sal/log.hxx>
+#include <o3tl/unreachable.hxx>
#include <osl/process.h>
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) && ENABLE_GSTREAMER_1_0 && QT5_HAVE_GOBJECT
#include <unx/gstsink.hxx>
@@ -769,7 +770,17 @@ bool QtInstance::DoExecute(int& nExitCode)
{
const bool bIsOnSystemEventLoop = Application::IsOnSystemEventLoop();
if (bIsOnSystemEventLoop)
+ {
+#if defined EMSCRIPTEN
+ // For Emscripten, QApplication::exec() will unwind the stack by throwing a JavaScript
+ // exception, so we need to manually undo the call of AcquireYieldMutex() done in InitVCL:
+ ImplGetSVData()->mpDefInst->ReleaseYieldMutex(false);
+#endif
nExitCode = QApplication::exec();
+#if defined EMSCRIPTEN
+ O3TL_UNREACHABLE;
+#endif
+ }
return bIsOnSystemEventLoop;
}