Showing the changes to interface/src/Application.cpp (1 of 16 files). Show all
Unified · Split
| @@ -380,17 +380,12 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 379 unmodified lines | ||
| 380 | 380 | |
| 381 | 381 | // start the nodeThread so its event loop is running |
| 382 | 382 | QThread* nodeThread = new QThread(this); |
| 383 | − nodeThread->setObjectName("Datagram Processor Thread"); | |
| 383 | + nodeThread->setObjectName("NodeList Thread"); | |
| 384 | 384 | nodeThread->start(); |
| 385 | 385 | |
| 386 | 386 | // make sure the node thread is given highest priority |
| 387 | 387 | nodeThread->setPriority(QThread::TimeCriticalPriority); |
| 388 | 388 | |
| 389 | − // have the NodeList use deleteLater from DM customDeleter | |
| 390 | − nodeList->setCustomDeleter([](Dependency* dependency) { | |
| 391 | − static_cast<NodeList*>(dependency)->deleteLater(); | |
| 392 | − }); | |
| 393 | − | |
| 394 | 389 | // setup a timer for domain-server check ins |
| 395 | 390 | QTimer* domainCheckInTimer = new QTimer(nodeList.data()); |
| 396 | 391 | connect(domainCheckInTimer, &QTimer::timeout, nodeList.data(), &NodeList::sendDomainServerCheckIn); |
| @@ -668,12 +663,11 @@ void Application::aboutToQuit() { · 271 unmodified lines | ||
| 668 | 663 | |
| 669 | 664 | void Application::cleanupBeforeQuit() { |
| 670 | 665 | |
| 671 | − // stop handling packets we've asked to handle | |
| 672 | − DependencyManager::get<LimitedNodeList>()->getPacketReceiver().unregisterListener(this); | |
| 673 | − | |
| 674 | 666 | _entities.clear(); // this will allow entity scripts to properly shutdown |
| 675 | − | |
| 676 | − //_datagramProcessor->shutdown(); // tell the datagram processor we're shutting down, so it can short circuit | |
| 667 | + | |
| 668 | + // tell the packet receiver we're shutting down, so it can drop packets | |
| 669 | + DependencyManager::get<NodeList>()->getPacketReceiver().setShouldDropPackets(true); | |
| 670 | + | |
| 677 | 671 | _entities.shutdown(); // tell the entities system we're shutting down, so it will stop running scripts |
| 678 | 672 | ScriptEngine::stopAllScripts(this); // stop all currently running global scripts |
| 679 | 673 | |
| @@ -748,6 +742,8 @@ Application::~Application() { · 68 unmodified lines | ||
| 748 | 742 | DependencyManager::destroy<SoundCache>(); |
| 749 | 743 | |
| 750 | 744 | QThread* nodeThread = DependencyManager::get<NodeList>()->thread(); |
| 745 | + | |
| 746 | + // remove the NodeList from the DependencyManager | |
| 751 | 747 | DependencyManager::destroy<NodeList>(); |
| 752 | 748 | |
| 753 | 749 | // ask the node thread to quit and wait until it is done |
| @@ -1801,7 +1797,6 @@ void Application::checkFPS() { · 1047 unmodified lines | ||
| 1801 | 1797 | |
| 1802 | 1798 | _fps = (float)_frameCount / diffTime; |
| 1803 | 1799 | _frameCount = 0; |
| 1804 | − //_datagramProcessor->resetCounters(); | |
| 1805 | 1800 | _timerStart.start(); |
| 1806 | 1801 | } |
| 1807 | 1802 | |