v8 allows us to enter an Isolate::scope multiple times in the same thread, so I widened it to our ScopeGuard as well.
Showing the changes to assignment-client/src/scripts/EntityScriptServer.cpp (1 of 14 files). Show all
Unified · Split
| @@ -477,8 +477,8 @@ void EntityScriptServer::resetEntitiesScriptEngine() { · 476 unmodified lines | ||
| 477 | 477 | newEngine->globalObject().setProperty("WebSocketServer", webSocketServerConstructorValue); |
| 478 | 478 | } |
| 479 | 479 | |
| 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()); | |
| 482 | 482 | |
| 483 | 483 | // connect this script engines printedMessage signal to the global ScriptEngines these various messages |
| 484 | 484 | auto scriptEngines = DependencyManager::get<ScriptEngines>().data(); |