mirror of
https://github.com/lubosz/overte.git
synced 2025-08-07 17:41:12 +02:00
Fixed interface scripts failing to shutdown and removed deprecated API signal
This commit is contained in:
parent
72137f52f7
commit
790a55d093
3 changed files with 12 additions and 16 deletions
|
@ -7550,12 +7550,18 @@ void Application::registerScriptEngineWithApplicationServices(ScriptManagerPoint
|
||||||
}
|
}
|
||||||
auto scriptingInterface = DependencyManager::get<controller::ScriptingInterface>();
|
auto scriptingInterface = DependencyManager::get<controller::ScriptingInterface>();
|
||||||
scriptEngine->registerGlobalObject("Controller", scriptingInterface.data());
|
scriptEngine->registerGlobalObject("Controller", scriptingInterface.data());
|
||||||
scriptManager->connect(scriptManager.get(), &ScriptManager::scriptEnding, [scriptManager]() {
|
|
||||||
// Request removal of controller routes with callbacks to a given script engine
|
{
|
||||||
auto userInputMapper = DependencyManager::get<UserInputMapper>();
|
auto connection = std::make_shared<QMetaObject::Connection>();
|
||||||
userInputMapper->scheduleScriptEndpointCleanup(scriptManager->engine().get());
|
*connection = scriptManager->connect(scriptManager.get(), &ScriptManager::scriptEnding, [scriptManager, connection]() {
|
||||||
// V8TODO: Maybe we should wait until removal is finished if there are still crashes
|
// Request removal of controller routes with callbacks to a given script engine
|
||||||
});
|
auto userInputMapper = DependencyManager::get<UserInputMapper>();
|
||||||
|
userInputMapper->scheduleScriptEndpointCleanup(scriptManager->engine().get());
|
||||||
|
QObject::disconnect(*connection);
|
||||||
|
// V8TODO: Maybe we should wait until removal is finished if there are still crashes
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
UserInputMapper::registerControllerTypes(scriptEngine.get());
|
UserInputMapper::registerControllerTypes(scriptEngine.get());
|
||||||
|
|
||||||
auto recordingInterface = DependencyManager::get<RecordingScriptingInterface>();
|
auto recordingInterface = DependencyManager::get<RecordingScriptingInterface>();
|
||||||
|
|
|
@ -32,7 +32,6 @@
|
||||||
connect(_manager, &ScriptManager::errorLoadingScript, this, &ScriptManagerScriptingInterface::errorLoadingScript);
|
connect(_manager, &ScriptManager::errorLoadingScript, this, &ScriptManagerScriptingInterface::errorLoadingScript);
|
||||||
connect(_manager, &ScriptManager::update, this, &ScriptManagerScriptingInterface::update);
|
connect(_manager, &ScriptManager::update, this, &ScriptManagerScriptingInterface::update);
|
||||||
connect(_manager, &ScriptManager::scriptEnding, this, &ScriptManagerScriptingInterface::scriptEnding);
|
connect(_manager, &ScriptManager::scriptEnding, this, &ScriptManagerScriptingInterface::scriptEnding);
|
||||||
connect(_manager, &ScriptManager::finished, this, &ScriptManagerScriptingInterface::finished);
|
|
||||||
connect(_manager, &ScriptManager::printedMessage, this, &ScriptManagerScriptingInterface::printedMessage);
|
connect(_manager, &ScriptManager::printedMessage, this, &ScriptManagerScriptingInterface::printedMessage);
|
||||||
connect(_manager, &ScriptManager::errorMessage, this, &ScriptManagerScriptingInterface::errorMessage);
|
connect(_manager, &ScriptManager::errorMessage, this, &ScriptManagerScriptingInterface::errorMessage);
|
||||||
connect(_manager, &ScriptManager::warningMessage, this, &ScriptManagerScriptingInterface::warningMessage);
|
connect(_manager, &ScriptManager::warningMessage, this, &ScriptManagerScriptingInterface::warningMessage);
|
||||||
|
|
|
@ -577,15 +577,6 @@ signals:
|
||||||
*/
|
*/
|
||||||
void scriptEnding();
|
void scriptEnding();
|
||||||
|
|
||||||
/*@jsdoc
|
|
||||||
* @function Script.finished
|
|
||||||
* @param {string} filename - File name.
|
|
||||||
* @param {object} engine - Engine.
|
|
||||||
* @returns {Signal}
|
|
||||||
* @deprecated This signal is deprecated and will be removed.
|
|
||||||
*/
|
|
||||||
void finished(const QString& fileNameString, ScriptManagerPointer);
|
|
||||||
|
|
||||||
/*@jsdoc
|
/*@jsdoc
|
||||||
* Triggered when the script prints a message to the program log via {@link print}, {@link Script.print},
|
* Triggered when the script prints a message to the program log via {@link print}, {@link Script.print},
|
||||||
* {@link console.log}, {@link console.debug}, {@link console.group}, {@link console.groupEnd}, {@link console.time}, or
|
* {@link console.log}, {@link console.debug}, {@link console.group}, {@link console.groupEnd}, {@link console.time}, or
|
||||||
|
|
Loading…
Reference in a new issue