Changeset 1552 for code/trunk/src/orxonox/tools
- Timestamp:
- Jun 6, 2008, 5:31:58 PM (17 years ago)
- Location:
- code/trunk/src/orxonox/tools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/orxonox/tools/Timer.cc
r1505 r1552 102 102 TimerBase::~TimerBase() 103 103 { 104 if (this->executor_) 105 delete this->executor_; 104 this->deleteExecutor(); 106 105 } 107 106 … … 112 111 { 113 112 (*this->executor_)(); 113 } 114 115 /** 116 @brief Deletes the executor. 117 */ 118 void TimerBase::deleteExecutor() 119 { 120 if (this->executor_) 121 delete this->executor_; 114 122 } 115 123 -
code/trunk/src/orxonox/tools/Timer.h
r1535 r1552 78 78 79 79 void run() const; 80 void deleteExecutor(); 80 81 81 82 /** @brief Starts the Timer: Function-call after 'interval' seconds. */ … … 149 150 void setTimer(float interval, bool bLoop, T* object, ExecutorMember<T>* executor) 150 151 { 152 this->deleteExecutor(); 153 151 154 this->interval_ = interval; 152 155 this->bLoop_ = bLoop; … … 185 188 void setTimer(float interval, bool bLoop, ExecutorStatic* executor) 186 189 { 190 this->deleteExecutor(); 191 187 192 this->interval_ = interval; 188 193 this->bLoop_ = bLoop;
Note: See TracChangeset
for help on using the changeset viewer.