void TimerUnit::removeAllTempTimers() { mCleanupList.clear(); for(auto it = mTimerRootNodeList.begin(); it != mTimerRootNodeList.end(); it++) { TTimer * pChild = *it; if( pChild->isTempTimer() ) { pChild->killTimer(); pChild->mOK_code = false; //important to not crash on stale Lua function args markCleanup( pChild ); } } }
bool TimerUnit::killTimer(const QString & name ) { for(auto it = mTimerRootNodeList.begin(); it != mTimerRootNodeList.end(); it++) { TTimer * pChild = *it; if( pChild->getName() == name ) { // only temporary timers can be killed if( ! pChild->isTempTimer() ) return false; pChild->killTimer(); markCleanup( pChild ); return true; } } return false; }
void TimerUnit::removeAllTempTimers() { //qDebug()<<"vorher: TIMERS: insgesamt:"<<mTimerRootNodeList.size()<<" cleanup:"<<mCleanupList.size(); mCleanupList.clear(); typedef list<TTimer *>::const_iterator I; for( I it = mTimerRootNodeList.begin(); it != mTimerRootNodeList.end(); it++) { TTimer * pChild = *it; if( pChild->isTempTimer() ) { pChild->killTimer(); pChild->mOK_code = false; //important to not crash on stale Lua function args markCleanup( pChild ); } } //qDebug()<<"TIMERS: insgesamt:"<<mTimerRootNodeList.size()<<" cleanup:"<<mCleanupList.size(); }
bool TimerUnit::killTimer( QString & name ) { //qDebug()<<"TimerUnit::killTimer() name="<<name; typedef list<TTimer *>::const_iterator I; for( I it = mTimerRootNodeList.begin(); it != mTimerRootNodeList.end(); it++) { TTimer * pChild = *it; if( pChild->getName() == name ) { // only temporary timers can be killed if( ! pChild->isTempTimer() ) return false; pChild->killTimer(); markCleanup( pChild ); return true; } } return false; }