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 9 months ago

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

Showing the changes to interface/src/scripting/RenderScriptingInterface.cpp (1 of 14 files). Show all

Unified · Split

interface/src/scripting/RenderScriptingInterface.cpp+5−2
@@ -30,9 +30,12 @@ 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();
34 auto* sgp = scopeGuard.get();
33 35
34 scriptEngine->registerEnum("Render.RenderMethod",QMetaEnum::fromType<RenderScriptingInterface::RenderMethod>());36
35 scriptEngine->registerEnum("AntialiasingMode",QMetaEnum::fromType<AntialiasingSetupConfig::Mode>());37 scriptEngine->registerEnum(sgp, "Render.RenderMethod",QMetaEnum::fromType<RenderScriptingInterface::RenderMethod>());
38 scriptEngine->registerEnum(sgp, "AntialiasingMode",QMetaEnum::fromType<AntialiasingSetupConfig::Mode>());
36});39});
37 40
38RenderScriptingInterface* RenderScriptingInterface::getInstance() {41RenderScriptingInterface* RenderScriptingInterface::getInstance() {