Showing the changes to libraries/script-engine/src/ScriptEngine.cpp (1 of 5 files). Show all
Unified · Split
| @@ -627,6 +627,9 @@ void ScriptEngine::init() { · 626 unmodified lines | |||
| 627 | qScriptRegisterMetaType(this, qWSCloseCodeToScriptValue, qWSCloseCodeFromScriptValue); | 627 | qScriptRegisterMetaType(this, qWSCloseCodeToScriptValue, qWSCloseCodeFromScriptValue); |
| 628 | qScriptRegisterMetaType(this, wscReadyStateToScriptValue, wscReadyStateFromScriptValue); | 628 | qScriptRegisterMetaType(this, wscReadyStateToScriptValue, wscReadyStateFromScriptValue); |
| 629 | 629 | ||
| 630 | // NOTE: You do not want to end up creating new instances of singletons here. They will be on the ScriptEngine thread | ||
| 631 | // and are likely to be unusable if we "reset" the ScriptEngine by creating a new one (on a whole new thread). | ||
| 632 | |||
| 630 | registerGlobalObject("Script", this); | 633 | registerGlobalObject("Script", this); |
| 631 | 634 | ||
| 632 | { | 635 | { |
| @@ -638,7 +641,8 @@ void ScriptEngine::init() { · 5 unmodified lines | |||
| 638 | resetModuleCache(); | 641 | resetModuleCache(); |
| 639 | } | 642 | } |
| 640 | 643 | ||
| 641 | registerGlobalObject("Audio", &AudioScriptingInterface::getInstance()); | 644 | registerGlobalObject("Audio", DependencyManager::get<AudioScriptingInterface>().data()); |
| 645 | |||
| 642 | registerGlobalObject("Entities", entityScriptingInterface.data()); | 646 | registerGlobalObject("Entities", entityScriptingInterface.data()); |
| 643 | registerGlobalObject("Quat", &_quatLibrary); | 647 | registerGlobalObject("Quat", &_quatLibrary); |
| 644 | registerGlobalObject("Vec3", &_vec3Library); | 648 | registerGlobalObject("Vec3", &_vec3Library); |