fix(color): fix EM crashes when shutting down Lua states (#6337)

This commit is contained in:
philmoz
2025-06-13 11:08:54 +10:00
committed by GitHub
parent ea6c28c8ea
commit 5c04801162
8 changed files with 106 additions and 92 deletions
+1 -1
View File
@@ -34,7 +34,7 @@
::testing::AssertionResult __luaExecStr(const char * str)
{
extern lua_State * lsScripts;
if (!lsScripts) luaInit();
if (!lsScripts) { luaInitMainState(); luaInit(); }
if (!lsScripts) return ::testing::AssertionFailure() << "No Lua state!";
if (luaL_dostring(lsScripts, str)) {
return ::testing::AssertionFailure() << "lua error: " << lua_tostring(lsScripts, -1);