From 38fcd8e3e139c096f99768c08464c9cb71359563 Mon Sep 17 00:00:00 2001 From: apio Date: Thu, 19 Sep 2024 18:26:42 +0200 Subject: [PATCH] libos: Stop timers in the destructor if needed Fixes some bug in InputField causing a crash. --- libos/src/Timer.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libos/src/Timer.cpp b/libos/src/Timer.cpp index 42db3804..f8309abd 100644 --- a/libos/src/Timer.cpp +++ b/libos/src/Timer.cpp @@ -110,6 +110,10 @@ namespace os Timer::~Timer() { - if (m_timerid >= 0) timer_delete(m_timerid); + if (m_timerid >= 0) + { + if (!m_stopped) stop(); + timer_delete(m_timerid); + } } }