Merge pull request #13492 from SimonWalton-HiFi/script-engine-thread

ScriptsModel instances should be created & destroyed on the same thread (for ESS)
This commit is contained in:
Clément Brisset 2018-07-03 13:30:29 -07:00 committed by GitHub
commit ee03670215
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -69,9 +69,6 @@ EntityScriptServer::EntityScriptServer(ReceivedMessage& message) : ThreadedAssig
DependencyManager::set<AudioInjectorManager>();
DependencyManager::set<ScriptCache>();
DependencyManager::set<ScriptEngines>(ScriptEngine::ENTITY_SERVER_SCRIPT);
DependencyManager::set<EntityScriptServerServices>();
// Needed to ensure the creation of the DebugDraw instance on the main thread
@ -254,6 +251,9 @@ void EntityScriptServer::handleEntityScriptCallMethodPacket(QSharedPointer<Recei
void EntityScriptServer::run() {
DependencyManager::set<ScriptEngines>(ScriptEngine::ENTITY_SERVER_SCRIPT);
DependencyManager::set<EntityScriptServerServices>();
// make sure we request our script once the agent connects to the domain
auto nodeList = DependencyManager::get<NodeList>();