Skip to content

Commit

Permalink
Merge pull request #81 from norberttak/lua-free-stack
Browse files Browse the repository at this point in the history
Lua: call luapop after all lua C calls
  • Loading branch information
norberttak authored Aug 11, 2023
2 parents df87773 + 7907d47 commit 6d12266
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/core/LuaHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,6 @@ int LuaHelper::do_string(std::string lua_str)
lua_enabled = false;
return EXIT_FAILURE;
}

return EXIT_SUCCESS;
}

Expand All @@ -469,6 +468,7 @@ int LuaHelper::do_string(std::string lua_str, double& ret_value)
return EXIT_FAILURE;

ret_value = lua_tonumber(lua, -1);
lua_pop(lua, 1);
return EXIT_SUCCESS;
}

Expand All @@ -479,5 +479,6 @@ int LuaHelper::do_string(std::string lua_str, std::string& ret_value)

const char* buffer = lua_tostring(lua, -1);
ret_value = buffer;
lua_pop(lua, 1);
return EXIT_SUCCESS;
}

0 comments on commit 6d12266

Please sign in to comment.