From ab11bd20851c5bb99f0e164ee5b0ebe3888628c0 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Fri, 29 Sep 2023 17:33:26 +0100 Subject: [PATCH] watchdog: remove thread on destroy --- src/helpers/Watchdog.cpp | 4 ++++ src/helpers/Watchdog.hpp | 1 + 2 files changed, 5 insertions(+) diff --git a/src/helpers/Watchdog.cpp b/src/helpers/Watchdog.cpp index 92f20dfb..f5d85df7 100644 --- a/src/helpers/Watchdog.cpp +++ b/src/helpers/Watchdog.cpp @@ -2,6 +2,10 @@ #include #include "config/ConfigManager.hpp" +CWatchdog::~CWatchdog() { + m_pWatchdog.reset(); +} + CWatchdog::CWatchdog() { m_iMainThreadPID = pthread_self(); diff --git a/src/helpers/Watchdog.hpp b/src/helpers/Watchdog.hpp index 1868bd0f..edbfb055 100644 --- a/src/helpers/Watchdog.hpp +++ b/src/helpers/Watchdog.hpp @@ -9,6 +9,7 @@ class CWatchdog { public: // must be called from the main thread CWatchdog(); + ~CWatchdog(); void startWatching(); void endWatching();