From 3c1938af3cc8d91f6cb2d2c6eb360e7c8038a082 Mon Sep 17 00:00:00 2001 From: lordmulder Date: Thu, 23 Feb 2012 17:00:22 +0100 Subject: [PATCH] Fixed a potential live-lock situation: Signals from the QThread can get lost, before we reach the QEventLoop->exec(), even if the required connections already exists. It seems that QApplication::processEvents() will discard signals for our QEventLoop, if that QEventLoop is not running yet! Without the QApplication::processEvents(), those signals would simply be enqueued until we call QEventLoop->exec(). In reality this bug was never triggered under normal circumstances, but it seems on some systems it can take longer to perform the "fade in" than to finish the initialization thread. In that situation the bug *was* triggered and caused the live-lock... --- src/Config.h | 2 +- src/Dialog_SplashScreen.cpp | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Config.h b/src/Config.h index 22902481..f83c0bf4 100644 --- a/src/Config.h +++ b/src/Config.h @@ -30,7 +30,7 @@ #define VER_LAMEXP_MINOR_LO 4 #define VER_LAMEXP_TYPE Beta #define VER_LAMEXP_PATCH 1 -#define VER_LAMEXP_BUILD 890 +#define VER_LAMEXP_BUILD 891 /////////////////////////////////////////////////////////////////////////////// // Tool versions (minimum expected versions!) diff --git a/src/Dialog_SplashScreen.cpp b/src/Dialog_SplashScreen.cpp index 579986c9..48461da5 100644 --- a/src/Dialog_SplashScreen.cpp +++ b/src/Dialog_SplashScreen.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include "WinSevenTaskbar.h" @@ -110,7 +111,12 @@ void SplashScreen::showSplash(QThread *thread) } //Loop while thread is running - loop->exec(); + while(thread->isRunning()) + { + QTimer::singleShot(15000, loop, SLOT(quit())); + loop->exec(); + if(thread->isRunning()) qWarning("Potential deadlock in Init thread!"); + } //Fade out for(int i = 100; i >= 0; i--)