Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Nodemcu Firmware
Commits
1b77d5d3
Commit
1b77d5d3
authored
Jan 04, 2021
by
Kit Klein
Committed by
Nathaniel Wesley Filardo
Jan 05, 2021
Browse files
ensure tmr ref is valid before cb occurs
parent
7c07f914
Changes
1
Hide whitespace changes
Inline
Side-by-side
components/modules/tmr.c
View file @
1b77d5d3
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment