From 0df4af4ba5e6edce825af6ecf6d024c704292633 Mon Sep 17 00:00:00 2001 From: wmayer Date: Sat, 28 Jan 2017 00:14:15 +0100 Subject: [PATCH] issue #0002540: Crash on startup --- src/Gui/Splashscreen.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/Gui/Splashscreen.cpp b/src/Gui/Splashscreen.cpp index 879528240..ec8e5bb0d 100644 --- a/src/Gui/Splashscreen.cpp +++ b/src/Gui/Splashscreen.cpp @@ -34,6 +34,10 @@ # include #endif +#if QT_VERSION < 0x050000 +# include +#endif + #include #include "Splashscreen.h" @@ -140,10 +144,16 @@ public: return; } - splash->showMessage(msg.replace(QLatin1String("\n"), QString()), alignment, textColor); - QMutex mutex; - QMutexLocker ml(&mutex); - QWaitCondition().wait(&mutex, 50); +#if QT_VERSION < 0x050000 + const QGLContext* ctx = QGLContext::currentContext(); + if (!ctx) +#endif + { + splash->showMessage(msg.replace(QLatin1String("\n"), QString()), alignment, textColor); + QMutex mutex; + QMutexLocker ml(&mutex); + QWaitCondition().wait(&mutex, 50); + } } private: