From fe4429fc7942a78856069e7eec8e68eb92e30de4 Mon Sep 17 00:00:00 2001 From: martii Date: Thu, 2 Jan 2014 21:28:28 +0100 Subject: [PATCH] gui/components/cc_frm_clock: disable thread idle timeout; clear clock when thread exits Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/9472155b88c87506575537a6ff007d4beb8042cf Author: martii Date: 2014-01-02 (Thu, 02 Jan 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_clock.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm_clock.cpp b/src/gui/components/cc_frm_clock.cpp index cc01ee1c1..c538faf5a 100644 --- a/src/gui/components/cc_frm_clock.cpp +++ b/src/gui/components/cc_frm_clock.cpp @@ -258,8 +258,10 @@ void* CComponentsFrmClock::initClockThread(void *arg) pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS,0); CComponentsFrmClock *clock = static_cast(arg); +#if 0 time_t count = time(0); - std::string format_str_save = clock->cl_format_str; +#endif + std::string format_str_save = clock->cl_format_str; // FIXME. This will cause setClockFormat() to be ignored. --martii //start loop for paint while(clock != NULL) { if (clock->paintClock) { @@ -274,12 +276,16 @@ void* CComponentsFrmClock::initClockThread(void *arg) } //paint segements, but wihtout saved backgrounds clock->paint(CC_SAVE_SCREEN_NO); +#if 0 count = time(0); +#endif } +#if 0 // memory leak, thread will not be joined --martii if (time(0) >= count+30) { clock->cl_thread = 0; break; } +#endif mySleep(clock->cl_interval); } return 0; @@ -316,6 +322,7 @@ bool CComponentsFrmClock::stopThread() return false; } } + kill(); cl_thread = 0; return true; }