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
30 30
31STATIC_SCRIPT_INITIALIZER(+[](ScriptManager* manager){31STATIC_SCRIPT_INITIALIZER(+[](ScriptManager* manager){
32 auto scriptEngine = manager->engine().get();32 auto scriptEngine = manager->engine().get();
33 auto scopeGuard = scriptEngine->getScopeGuard();
33 34
34 scriptEngine->registerEnum("PlatformInfo.PlatformTier",QMetaEnum::fromType<PlatformInfoScriptingInterface::PlatformTier>());35 scriptEngine->registerEnum(scopeGuard.get(), "PlatformInfo.PlatformTier",QMetaEnum::fromType<PlatformInfoScriptingInterface::PlatformTier>());
35});36});
36 37
37PlatformInfoScriptingInterface* PlatformInfoScriptingInterface::getInstance() {38PlatformInfoScriptingInterface* PlatformInfoScriptingInterface::getInstance() {