diff options
Diffstat (limited to 'supervisor/shared/background_callback.c')
| -rw-r--r-- | supervisor/shared/background_callback.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/supervisor/shared/background_callback.c b/supervisor/shared/background_callback.c index d10579c4f..8e12dd362 100644 --- a/supervisor/shared/background_callback.c +++ b/supervisor/shared/background_callback.c @@ -24,6 +24,8 @@ * THE SOFTWARE. */ +#include <string.h> + #include "py/gc.h" #include "py/mpconfig.h" #include "supervisor/background_callback.h" @@ -101,6 +103,12 @@ void background_callback_end_critical_section() { void background_callback_reset() { CALLBACK_CRITICAL_BEGIN; + background_callback_t *cb = (background_callback_t*)callback_head; + while(cb) { + background_callback_t *next = cb->next; + memset(cb, 0, sizeof(*cb)); + cb = next; + } callback_head = NULL; callback_tail = NULL; in_background_callback = false; |
