History

script-engine: force callers of register* functions to hold a scope guard

v8 allows us to enter an Isolate::scope multiple times in the same thread, so I widened it to our ScopeGuard as well.

RTUnreal committed 8 months ago

Commit 3a6d77a1 parent 82fb89f14 files · +165 −132Browse files

Showing the changes to assignment-client/src/scripts/EntityScriptServer.cpp (1 of 14 files). Show all

Unified · Split

assignment-client/src/scripts/EntityScriptServer.cpp+2−2
@@ -477,8 +477,8 @@ void EntityScriptServer::resetEntitiesScriptEngine() { · 476 unmodified lines
477477 newEngine->globalObject().setProperty("WebSocketServer", webSocketServerConstructorValue);
478478 }
479479
480− newEngine->registerGlobalObject("SoundCache", DependencyManager::get<SoundCacheScriptingInterface>().data());
481− newEngine->registerGlobalObject("AvatarList", DependencyManager::get<AvatarHashMap>().data());
480+ newEngine->registerGlobalObject(guard.get(), "SoundCache", DependencyManager::get<SoundCacheScriptingInterface>().data());
481+ newEngine->registerGlobalObject(guard.get(), "AvatarList", DependencyManager::get<AvatarHashMap>().data());
482482
483483 // connect this script engines printedMessage signal to the global ScriptEngines these various messages
484484 auto scriptEngines = DependencyManager::get<ScriptEngines>().data();