Commit 1b77d5d3 authored by Kit Klein's avatar Kit Klein Committed by Nathaniel Wesley Filardo
Browse files

ensure tmr ref is valid before cb occurs

parent 7c07f914
...@@ -43,7 +43,7 @@ static void alarm_timer_task(task_param_t param, task_prio_t prio) ...@@ -43,7 +43,7 @@ static void alarm_timer_task(task_param_t param, task_prio_t prio)
{ {
tmr_t tmr = (tmr_t)param; tmr_t tmr = (tmr_t)param;
lua_State* L = lua_getstate(); lua_State* L = lua_getstate();
if (tmr->cb_ref == LUA_NOREF) if (tmr->cb_ref == LUA_NOREF || tmr->self_ref == LUA_NOREF)
return; return;
lua_rawgeti(L, LUA_REGISTRYINDEX, tmr->cb_ref); lua_rawgeti(L, LUA_REGISTRYINDEX, tmr->cb_ref);
lua_rawgeti(L, LUA_REGISTRYINDEX, tmr->self_ref); lua_rawgeti(L, LUA_REGISTRYINDEX, tmr->self_ref);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment