Changeset 2087 for code/trunk/src/orxonox/tools/Timer.cc
- Timestamp:
- Nov 1, 2008, 7:04:09 PM (16 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
-
code/trunk/src/orxonox/tools/Timer.cc
r1755 r2087 92 92 this->bLoop_ = false; 93 93 this->bActive_ = false; 94 this->bKillAfterCall_ = false; 94 95 95 96 this->time_ = 0; … … 111 112 void TimerBase::run() const 112 113 { 114 bool temp = this->bKillAfterCall_; // to avoid errors with bKillAfterCall_=false and an exutors which destroy the timer 115 113 116 (*this->executor_)(); 117 118 if (temp) 119 delete this; 114 120 } 115 121 … … 136 142 { 137 143 // It's time to call the function 138 if (this->bLoop_ )144 if (this->bLoop_ && !this->bKillAfterCall_) 139 145 { 140 146 this->time_ += this->interval_; // Q: Why '+=' and not '='? A: Think about it. It's more accurate like that. Seriously.
Note: See TracChangeset
for help on using the changeset viewer.