fix lua oom errors

This commit is contained in:
Squibid 2025-12-10 22:31:18 -05:00
parent 9553e3831f
commit 1e973eff94
Signed by: squibid
GPG key ID: BECE5684D3C4005D
4 changed files with 14 additions and 23 deletions

View file

@ -41,17 +41,13 @@ pub fn add_keymap(L: *zlua.Lua) i32 {
_ = L.pushString("press");
_ = L.getTable(3);
if (L.isFunction(-1)) {
keymap.options.lua_press_ref_idx = L.ref(zlua.registry_index) catch {
L.raiseErrorStr("Lua error check your config", .{}); // TODO: Insert more descrptive errors
};
keymap.options.lua_press_ref_idx = L.ref(zlua.registry_index) catch Utils.oomPanic();
}
_ = L.pushString("release");
_ = L.getTable(3);
if (L.isFunction(-1)) {
keymap.options.lua_release_ref_idx = L.ref(zlua.registry_index) catch {
L.raiseErrorStr("Lua error check your config", .{}); // TODO: Insert more descrptive errors
};
keymap.options.lua_release_ref_idx = L.ref(zlua.registry_index) catch Utils.oomPanic();
}
_ = L.pushString("repeat");