cc_timer.cpp: don't loop if slot OnTimer is empty

Just for safety and to save resources.
This commit is contained in:
2018-02-18 15:33:50 +01:00
parent d7e5a3eff1
commit 0e438e0a95

View File

@@ -75,7 +75,7 @@ void CComponentsTimer::runSharedTimerAction()
//start loop
tn = "cc:"+name;
set_threadname(tn.c_str());
while(tm_enable && tm_interval > 0) {
while(tm_enable && tm_interval > 0 && !OnTimer.empty()) {
tm_mutex.lock();
OnTimer();
if (!tm_enable_nano){