From b6e4575dea7f59bf12ab934615cbaec7c52bbd54 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Tue, 10 Dec 2013 12:46:00 +0100 Subject: [PATCH] Do not initialize all the application if another instance is running This fixes a crash becasue we were constructing the systemtray and then destroying it too early before the systemtray could initilize itself. (This work around a bug in QSystemTray which crashes if it is destroyed before it is registered to the X11 server) --- src/main.cpp | 1 - src/mirall/application.cpp | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 33890726d..043f800dc 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -35,7 +35,6 @@ int main(int argc, char **argv) Q_INIT_RESOURCE(mirall); Mirall::Application app(argc, argv); - app.initialize(); #ifndef Q_OS_WIN signal(SIGPIPE, SIG_IGN); #endif diff --git a/src/mirall/application.cpp b/src/mirall/application.cpp index c7af72404..d529a2db5 100644 --- a/src/mirall/application.cpp +++ b/src/mirall/application.cpp @@ -95,6 +95,10 @@ Application::Application(int &argc, char **argv) : //no need to waste time; if ( _helpOnly ) return; + initialize(); + if (isRunning()) + return; + setupLogging(); setupTranslations();