Scripting: More cleanup

This commit is contained in:
Vicki Pfau 2022-06-09 14:54:30 -07:00
parent b43509e705
commit aee35a4442
1 changed files with 4 additions and 1 deletions

View File

@ -182,6 +182,9 @@ void _luaDestroy(struct mScriptEngineContext* ctx) {
if (luaContext->func > 0) {
luaL_unref(luaContext->lua, LUA_REGISTRYINDEX, luaContext->func);
}
if (luaContext->require > 0) {
luaL_unref(luaContext->lua, LUA_REGISTRYINDEX, luaContext->require);
}
lua_close(luaContext->lua);
free(luaContext);
}
@ -1047,5 +1050,5 @@ static int _luaRequireShim(lua_State* lua) {
lua_error(luaContext->lua);
}
return 0;
return 1;
}