mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-07-23 19:04:29 +02:00
guard perpetual AC domain connection if NL thread locked
This commit is contained in:
parent
b968911fcc
commit
500a96ee7c
1 changed files with 7 additions and 2 deletions
|
@ -43,7 +43,9 @@ void ThreadedAssignment::setFinished(bool isFinished) {
|
||||||
packetReceiver.setShouldDropPackets(true);
|
packetReceiver.setShouldDropPackets(true);
|
||||||
|
|
||||||
if (_domainServerTimer) {
|
if (_domainServerTimer) {
|
||||||
_domainServerTimer->stop();
|
// stop the domain-server check in timer by calling deleteLater so it gets cleaned up on NL thread
|
||||||
|
_domainServerTimer->deleteLater();
|
||||||
|
_domainServerTimer = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_statsTimer) {
|
if (_statsTimer) {
|
||||||
|
@ -65,10 +67,13 @@ void ThreadedAssignment::commonInit(const QString& targetName, NodeType_t nodeTy
|
||||||
auto nodeList = DependencyManager::get<NodeList>();
|
auto nodeList = DependencyManager::get<NodeList>();
|
||||||
nodeList->setOwnerType(nodeType);
|
nodeList->setOwnerType(nodeType);
|
||||||
|
|
||||||
_domainServerTimer = new QTimer(this);
|
_domainServerTimer = new QTimer(nodeList.data());
|
||||||
connect(_domainServerTimer, SIGNAL(timeout()), this, SLOT(checkInWithDomainServerOrExit()));
|
connect(_domainServerTimer, SIGNAL(timeout()), this, SLOT(checkInWithDomainServerOrExit()));
|
||||||
_domainServerTimer->start(DOMAIN_SERVER_CHECK_IN_MSECS);
|
_domainServerTimer->start(DOMAIN_SERVER_CHECK_IN_MSECS);
|
||||||
|
|
||||||
|
// move the domain server time to the NL so check-ins fire from there
|
||||||
|
_domainServerTimer->moveToThread(nodeList->thread());
|
||||||
|
|
||||||
if (shouldSendStats) {
|
if (shouldSendStats) {
|
||||||
// start sending stats packet once we connect to the domain
|
// start sending stats packet once we connect to the domain
|
||||||
connect(&nodeList->getDomainHandler(), &DomainHandler::connectedToDomain, this, &ThreadedAssignment::startSendingStats);
|
connect(&nodeList->getDomainHandler(), &DomainHandler::connectedToDomain, this, &ThreadedAssignment::startSendingStats);
|
||||||
|
|
Loading…
Reference in a new issue