From 81350e95ddcbb3c97fa7ba9ce87cd6d567079733 Mon Sep 17 00:00:00 2001 From: Ondrej Novak Date: Wed, 1 Apr 2026 13:40:00 +0200 Subject: [PATCH] fix: crash when deinitializing unused timers on unix --- micropy_updates/unix/machine_timer.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/micropy_updates/unix/machine_timer.c b/micropy_updates/unix/machine_timer.c index 4aee543c..2deca98f 100644 --- a/micropy_updates/unix/machine_timer.c +++ b/micropy_updates/unix/machine_timer.c @@ -91,7 +91,9 @@ void machine_timer_deinit_all(void) pthread_mutex_unlock(&timer_lock); timer_polling = false; - pthread_join(timer_poll_thread_id, NULL); + if (timer_poll_thread_id != 0) { + pthread_join(timer_poll_thread_id, NULL); + } pthread_mutex_destroy(&timer_lock); timer = NULL;