SingleApplication: Use QCoreApplication::exit() instead of ::exit()
authorPalo Kisa <palo.kisa@gmail.com>
Mon, 8 Feb 2016 10:57:12 +0000 (11:57 +0100)
committerPalo Kisa <palo.kisa@gmail.com>
Mon, 7 Mar 2016 11:57:49 +0000 (12:57 +0100)
lxqtsingleapplication.cpp

index 748f2d9..90a351b 100644 (file)
@@ -32,6 +32,7 @@
 #include <QDBusMessage>
 #include <QWidget>
 #include <QDebug>
+#include <QTimer>
 
 using namespace LXQt;
 
@@ -57,7 +58,7 @@ SingleApplication::SingleApplication(int &argc, char **argv, StartOptions option
             return;
         } else {
             qCritical() << Q_FUNC_INFO << errorMessage;
-            ::exit(1);
+            QTimer::singleShot(0, [this] { exit(1); });
         }
     }
 
@@ -74,7 +75,7 @@ SingleApplication::SingleApplication(int &argc, char **argv, StartOptions option
             QStringLiteral("activateWindow"));
         QDBusConnection::sessionBus().send(msg);
 
-        ::exit(0);
+        QTimer::singleShot(0, [this] { exit(0); });
     }
 }