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 interface/src/scripting/PlatformInfoScriptingInterface.cpp (1 of 14 files). Show all

Unified · Split

interface/src/scripting/PlatformInfoScriptingInterface.cpp+2−1
@@ -30,8 +30,9 @@ STATIC_SCRIPT_TYPES_INITIALIZER((+[](ScriptManager* manager){ · 29 unmodified lines
3030
3131 STATIC_SCRIPT_INITIALIZER(+[](ScriptManager* manager){
3232 auto scriptEngine = manager->engine().get();
33+ auto scopeGuard = scriptEngine->getScopeGuard();
3334
34− scriptEngine->registerEnum("PlatformInfo.PlatformTier",QMetaEnum::fromType<PlatformInfoScriptingInterface::PlatformTier>());
35+ scriptEngine->registerEnum(scopeGuard.get(), "PlatformInfo.PlatformTier",QMetaEnum::fromType<PlatformInfoScriptingInterface::PlatformTier>());
3536 });
3637
3738 PlatformInfoScriptingInterface* PlatformInfoScriptingInterface::getInstance() {