summaryrefslogtreecommitdiff
path: root/src/lua/lua_database.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/lua/lua_database.cpp')
-rw-r--r--src/lua/lua_database.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lua/lua_database.cpp b/src/lua/lua_database.cpp
index 79916115..4a7c82a5 100644
--- a/src/lua/lua_database.cpp
+++ b/src/lua/lua_database.cpp
@@ -14,6 +14,7 @@
#include "esp_log.h"
#include "lauxlib.h"
#include "lua.h"
+#include "lua_thread.hpp"
#include "lvgl.h"
#include "database.hpp"
@@ -108,7 +109,7 @@ static auto db_iterate(lua_State* state) -> int {
} else {
lua_pushnil(state);
}
- lua_call(state, 1, 0);
+ CallProtected(state, 1, 0);
luaL_unref(state, LUA_REGISTRYINDEX, callback_ref);
});
});
@@ -139,7 +140,6 @@ static auto push_iterator(
lua_pushcclosure(state, db_iterate, 1);
}
-
static auto record_text(lua_State* state) -> int {
LuaRecord* data = reinterpret_cast<LuaRecord*>(
luaL_checkudata(state, 1, kDbRecordMetatable));