diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 7727708c0f..0dba4498d5 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -1190,13 +1190,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo // setup a timer for domain-server check ins QTimer* domainCheckInTimer = new QTimer(this); - QWeakPointer nodeListWeak = nodeList; - connect(domainCheckInTimer, &QTimer::timeout, [this, nodeListWeak] { - auto nodeList = nodeListWeak.lock(); - if (!isServerlessMode() && nodeList) { - nodeList->sendDomainServerCheckIn(); - } - }); + connect(domainCheckInTimer, &QTimer::timeout, nodeList.data(), &NodeList::sendDomainServerCheckIn); domainCheckInTimer->start(DOMAIN_SERVER_CHECK_IN_MSECS); connect(this, &QCoreApplication::aboutToQuit, [domainCheckInTimer] { domainCheckInTimer->stop(); @@ -3886,6 +3880,7 @@ void Application::setIsInterstitialMode(bool interstitialMode) { } void Application::setIsServerlessMode(bool serverlessDomain) { + DependencyManager::get()->setSendDomainServerCheckInEnabled(!serverlessDomain); auto tree = getEntities()->getTree(); if (tree) { tree->setIsServerlessMode(serverlessDomain); @@ -5439,9 +5434,7 @@ void Application::init() { qCDebug(interfaceapp) << "Loaded settings"; // fire off an immediate domain-server check in now that settings are loaded - if (!isServerlessMode()) { - DependencyManager::get()->sendDomainServerCheckIn(); - } + QMetaObject::invokeMethod(DependencyManager::get().data(), "sendDomainServerCheckIn"); // This allows collision to be set up properly for shape entities supported by GeometryCache. // This is before entity setup to ensure that it's ready for whenever instance collision is initialized. diff --git a/libraries/networking/src/NodeList.cpp b/libraries/networking/src/NodeList.cpp index 3a80745115..b3862e4252 100644 --- a/libraries/networking/src/NodeList.cpp +++ b/libraries/networking/src/NodeList.cpp @@ -292,7 +292,8 @@ void NodeList::addSetOfNodeTypesToNodeInterestSet(const NodeSet& setOfNodeTypes) void NodeList::sendDomainServerCheckIn() { - // This function is called by the server check-in timer thread + // On ThreadedAssignments (assignment clients), this function + // is called by the server check-in timer thread // not the NodeList thread. Calling it on the NodeList thread // resulted in starvation of the server check-in function. // be VERY CAREFUL modifying this code as members of NodeList