[Orxonox-commit 1077] r5798 - code/branches/core5/src/libraries/tools
landauf at orxonox.net
landauf at orxonox.net
Sat Sep 26 22:18:24 CEST 2009
Author: landauf
Date: 2009-09-26 22:18:24 +0200 (Sat, 26 Sep 2009)
New Revision: 5798
Modified:
code/branches/core5/src/libraries/tools/Timer.cc
code/branches/core5/src/libraries/tools/Timer.h
Log:
replaced delete with destroy() in tools
Modified: code/branches/core5/src/libraries/tools/Timer.cc
===================================================================
--- code/branches/core5/src/libraries/tools/Timer.cc 2009-09-26 20:17:21 UTC (rev 5797)
+++ code/branches/core5/src/libraries/tools/Timer.cc 2009-09-26 20:18:24 UTC (rev 5798)
@@ -66,7 +66,7 @@
void executeDelayedCommand(StaticTimer* timer, const std::string& command)
{
CommandExecutor::execute(command);
- delete timer;
+ timer->destroy();
delaytimerset.erase(timer);
}
@@ -76,7 +76,7 @@
void killdelays()
{
for (std::set<StaticTimer*>::iterator it = delaytimerset.begin(); it != delaytimerset.end(); ++it)
- delete (*it);
+ (*it)->destroy();
delaytimerset.clear();
}
@@ -108,14 +108,14 @@
/**
@brief Executes the executor.
*/
- void TimerBase::run() const
+ void TimerBase::run()
{
bool temp = this->bKillAfterCall_; // to avoid errors with bKillAfterCall_=false and an exutors which destroy the timer
(*this->executor_)();
if (temp)
- delete this;
+ this->destroy();
}
/**
Modified: code/branches/core5/src/libraries/tools/Timer.h
===================================================================
--- code/branches/core5/src/libraries/tools/Timer.h 2009-09-26 20:17:21 UTC (rev 5797)
+++ code/branches/core5/src/libraries/tools/Timer.h 2009-09-26 20:18:24 UTC (rev 5798)
@@ -79,7 +79,7 @@
public:
~TimerBase();
- void run() const;
+ void run();
void deleteExecutor();
/** @brief Starts the Timer: Function-call after 'interval' seconds. */
More information about the Orxonox-commit
mailing list