From 061e71337bfa2aa5062cb08d5ab73691dbdd2e2e Mon Sep 17 00:00:00 2001 From: sledgehammer999 Date: Thu, 22 Jan 2015 17:47:53 +0200 Subject: [PATCH] Initialize logger at the beginning of program to avoid threading issues. --- src/main.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index 63ab331f6..b26a6f1e9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -74,6 +74,7 @@ Q_IMPORT_PLUGIN(qico) #include #include "misc.h" #include "preferences.h" +#include "logger.h" class MessagesCollector : public QObject { @@ -143,6 +144,8 @@ QBtCommandLineParameters parseCommandLine(); // Main int main(int argc, char *argv[]) { + //Initialize logger singleton here to avoid threading issues + Logger::instance()->addMessage(QObject::tr("qBittorrent %1 started", "qBittorrent v3.2.0alpha started").arg(VERSION)); // We must save it here because QApplication constructor may change it bool isOneArg = (argc == 2);