try to fix tm thread

This commit is contained in:
Jacek Jendrzej
2017-09-14 12:09:40 +02:00
parent d30bd0ea26
commit 513850f915

View File

@@ -43,11 +43,11 @@ CComponentsTimer::CComponentsTimer(const int& interval, bool is_nano)
tm_thread = 0; tm_thread = 0;
tm_interval = interval; tm_interval = interval;
tm_enable_nano = is_nano; tm_enable_nano = is_nano;
tm_enable = false;
sl_stop_timer = sigc::mem_fun(*this, &CComponentsTimer::stopTimer); sl_stop_timer = sigc::mem_fun(*this, &CComponentsTimer::stopTimer);
if (interval > 0) if (interval > 0)
startTimer(); tm_enable = startTimer();
} }
CComponentsTimer::~CComponentsTimer() CComponentsTimer::~CComponentsTimer()
@@ -132,12 +132,11 @@ void CComponentsTimer::stopThread()
bool CComponentsTimer::startTimer() bool CComponentsTimer::startTimer()
{ {
tm_enable = true;
initThread(); initThread();
if(tm_thread) if(tm_thread)
return true; tm_enable = true;
return false; return tm_enable;
} }
bool CComponentsTimer::stopTimer() bool CComponentsTimer::stopTimer()