mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 17:03:58 +02:00
tweaks to script engine shutdown behavior
This commit is contained in:
parent
524a41468c
commit
af52be7860
2 changed files with 13 additions and 2 deletions
|
@ -263,6 +263,8 @@ Application::~Application() {
|
|||
delete _settings;
|
||||
delete _followMode;
|
||||
delete _glWidget;
|
||||
|
||||
qDebug() << "DONE... Application::~Application()\n";
|
||||
}
|
||||
|
||||
void Application::restoreSizeAndPosition() {
|
||||
|
@ -4435,8 +4437,8 @@ void Application::loadScript() {
|
|||
connect(scriptEngine, SIGNAL(finished()), workerThread, SLOT(quit()));
|
||||
|
||||
// when the thread is terminated, add both scriptEngine and thread to the deleteLater queue
|
||||
connect(workerThread, SIGNAL(terminated()), scriptEngine, SLOT(deleteLater()));
|
||||
connect(workerThread, SIGNAL(terminated()), workerThread, SLOT(deleteLater()));
|
||||
connect(workerThread, SIGNAL(finished()), scriptEngine, SLOT(deleteLater()));
|
||||
connect(workerThread, SIGNAL(finished()), workerThread, SLOT(deleteLater()));
|
||||
|
||||
// when the application is about to quit, stop our script engine so it unwinds properly
|
||||
connect(this, SIGNAL(aboutToQuit()), scriptEngine, SLOT(stop()));
|
||||
|
|
|
@ -102,7 +102,15 @@ void ScriptEngine::run() {
|
|||
usleep(usecToSleep);
|
||||
}
|
||||
|
||||
if (_isFinished) {
|
||||
break;
|
||||
}
|
||||
|
||||
QCoreApplication::processEvents();
|
||||
|
||||
if (_isFinished) {
|
||||
break;
|
||||
}
|
||||
|
||||
bool willSendVisualDataCallBack = false;
|
||||
if (_voxelScriptingInterface.getVoxelPacketSender()->serversExist()) {
|
||||
|
@ -138,5 +146,6 @@ void ScriptEngine::run() {
|
|||
}
|
||||
}
|
||||
cleanMenuItems();
|
||||
qDebug() << "About to emit finished...\n";
|
||||
emit finished();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue