Showing the changes to interface/src/Application.cpp (1 of 4 files). Show all
Unified · Split
| @@ -3538,7 +3538,7 @@ void Application::registerScriptEngineWithApplicationServices(ScriptEngine* scri · 3537 unmodified lines | |||
| 3538 | connect(workerThread, SIGNAL(finished()), workerThread, SLOT(deleteLater())); | 3538 | connect(workerThread, SIGNAL(finished()), workerThread, SLOT(deleteLater())); |
| 3539 | 3539 | ||
| 3540 | // when the application is about to quit, stop our script engine so it unwinds properly | 3540 | // when the application is about to quit, stop our script engine so it unwinds properly |
| 3541 | connect(this, SIGNAL(aboutToQuit()), scriptEngine, SLOT(stop())); | 3541 | //connect(this, SIGNAL(aboutToQuit()), scriptEngine, SLOT(stop())); |
| 3542 | 3542 | ||
| 3543 | auto nodeList = DependencyManager::get<NodeList>(); | 3543 | auto nodeList = DependencyManager::get<NodeList>(); |
| 3544 | connect(nodeList.data(), &NodeList::nodeKilled, scriptEngine, &ScriptEngine::nodeKilled); | 3544 | connect(nodeList.data(), &NodeList::nodeKilled, scriptEngine, &ScriptEngine::nodeKilled); |
| @@ -3550,7 +3550,14 @@ void Application::registerScriptEngineWithApplicationServices(ScriptEngine* scri · 5 unmodified lines | |||
| 3550 | } | 3550 | } |
| 3551 | 3551 | ||
| 3552 | ScriptEngine* Application::loadScript(const QString& scriptFilename, bool isUserLoaded, | 3552 | ScriptEngine* Application::loadScript(const QString& scriptFilename, bool isUserLoaded, |
| 3553 | bool loadScriptFromEditor, bool activateMainWindow) { | 3553 | bool loadScriptFromEditor, bool activateMainWindow) { |
| 3554 | |||
| 3555 | qDebug() << "Application::loadScript() " << scriptFilename << "line:" << __LINE__; | ||
| 3556 | if (isAboutToQuit()) { | ||
| 3557 | qDebug() << "Application::loadScript() WHILE QUITTING.... what to do????" << scriptFilename << "line:" << __LINE__; | ||
| 3558 | return NULL; | ||
| 3559 | } | ||
| 3560 | |||
| 3554 | QUrl scriptUrl(scriptFilename); | 3561 | QUrl scriptUrl(scriptFilename); |
| 3555 | const QString& scriptURLString = scriptUrl.toString(); | 3562 | const QString& scriptURLString = scriptUrl.toString(); |
| 3556 | if (_scriptEnginesHash.contains(scriptURLString) && loadScriptFromEditor | 3563 | if (_scriptEnginesHash.contains(scriptURLString) && loadScriptFromEditor |