From 2409c83d5df089f5672bc7d14e0b99d421d3212d Mon Sep 17 00:00:00 2001 From: Brad Davis Date: Wed, 5 Jul 2017 16:53:42 -0700 Subject: [PATCH] Fix ACClient on Linux --- libraries/shared/src/ThreadHelpers.cpp | 7 +++---- tools/ac-client/src/ACClientApp.cpp | 6 ++++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/libraries/shared/src/ThreadHelpers.cpp b/libraries/shared/src/ThreadHelpers.cpp index 14ae35762b..8f3d16a577 100644 --- a/libraries/shared/src/ThreadHelpers.cpp +++ b/libraries/shared/src/ThreadHelpers.cpp @@ -17,10 +17,6 @@ void moveToNewNamedThread(QObject* object, const QString& name, std::functionsetObjectName(name); - if (priority != QThread::InheritPriority) { - thread->setPriority(priority); - } - QString tempName = name; QObject::connect(thread, &QThread::started, [startCallback] { startCallback(); @@ -32,6 +28,9 @@ void moveToNewNamedThread(QObject* object, const QString& name, std::functionmoveToThread(thread); thread->start(); + if (priority != QThread::InheritPriority) { + thread->setPriority(priority); + } } void moveToNewNamedThread(QObject* object, const QString& name, QThread::Priority priority) { diff --git a/tools/ac-client/src/ACClientApp.cpp b/tools/ac-client/src/ACClientApp.cpp index b81d092662..28f91e8121 100644 --- a/tools/ac-client/src/ACClientApp.cpp +++ b/tools/ac-client/src/ACClientApp.cpp @@ -90,14 +90,16 @@ ACClientApp::ACClientApp(int argc, char* argv[]) : auto nodeList = DependencyManager::get(); - // start the nodeThread so its event loop is running - nodeList->startThread(); // setup a timer for domain-server check ins QTimer* domainCheckInTimer = new QTimer(nodeList.data()); connect(domainCheckInTimer, &QTimer::timeout, nodeList.data(), &NodeList::sendDomainServerCheckIn); domainCheckInTimer->start(DOMAIN_SERVER_CHECK_IN_MSECS); + // start the nodeThread so its event loop is running + // (must happen after the checkin timer is created with the nodelist as it's parent) + nodeList->startThread(); + const DomainHandler& domainHandler = nodeList->getDomainHandler(); connect(&domainHandler, SIGNAL(hostnameChanged(const QString&)), SLOT(domainChanged(const QString&)));