File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -228,8 +228,10 @@ static const os_param_t TIMER_OWNER = 0x6770696f; // "gpio"
228228static void seroutasync_done (task_param_t arg )
229229{
230230 lua_State * L = lua_getstate ();
231- luaM_freearray (L , serout .delay_table , serout .tablelen , uint32 );
232- serout .delay_table = NULL ;
231+ if (serout .delay_table ) {
232+ luaM_freearray (L , serout .delay_table , serout .tablelen , uint32 );
233+ serout .delay_table = NULL ;
234+ }
233235 if (serout .lua_done_ref != LUA_NOREF ) {
234236 lua_rawgeti (L , LUA_REGISTRYINDEX , serout .lua_done_ref );
235237 luaL_unref (L , LUA_REGISTRYINDEX , serout .lua_done_ref );
@@ -310,6 +312,7 @@ static int lgpio_serout( lua_State* L )
310312 }
311313 } while (serout .repeats -- );
312314 luaM_freearray (L , serout .delay_table , serout .tablelen , uint32 );
315+ serout .delay_table = NULL ;
313316 }
314317 return 0 ;
315318}
You can’t perform that action at this time.
0 commit comments