From e39222a183d89fe91aad91076b4221c99a271816 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 29 May 2017 21:14:10 +0200 Subject: [PATCH] CComponentsTimer: exec OnTimer cleanup after stopped thread Users reported about crashes, but I could not verify them by myself. Supplement to: 1628e76f66f8b8b6134f14a5698ea2ddea60610e Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/6e9e4de63842bf6c6695bb4117793fc4b4c5067d Author: Thilo Graf Date: 2017-05-29 (Mon, 29 May 2017) ------------------ This commit was generated by Migit --- src/gui/components/cc_timer.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_timer.cpp b/src/gui/components/cc_timer.cpp index d6659aa38..5f32adf2d 100644 --- a/src/gui/components/cc_timer.cpp +++ b/src/gui/components/cc_timer.cpp @@ -143,10 +143,12 @@ bool CComponentsTimer::startTimer() bool CComponentsTimer::stopTimer() { tm_enable = false; - OnTimer.clear(); stopThread(); - if(tm_thread == 0) + if(tm_thread == 0){ + if (!OnTimer.empty()) + OnTimer.clear(); return true; + } return false; }