Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 11018


Ignore:
Timestamp:
Jan 2, 2016, 8:59:12 PM (8 years ago)
Author:
landauf
Message:

I think it's sufficient if Timer is a Listable. A timer is often used as a member object in other classes, so it's probably a bad idea to make it a Destroyable since it will neither be deleted with destroy() nor will it survive the lifespan of its parent even if a StrongPtr references it.

Location:
code/trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/libraries/tools/Timer.cc

    r10624 r11018  
    104104    {
    105105        CommandExecutor::execute(command);
    106         timer->destroy();
     106        delete timer;
    107107        delaytimers.right.erase(timer);
    108108    }
     
    114114    {
    115115        for (boost::bimap<unsigned int, Timer*>::left_map::iterator it = delaytimers.left.begin(); it != delaytimers.left.end(); ++it)
    116             it->second->destroy();
     116            delete it->second;
    117117
    118118        delaytimers.clear();
     
    127127        if (it != delaytimers.left.end())
    128128        {
    129             it->second->destroy();
     129            delete it->second;
    130130            delaytimers.left.erase(it);
    131131        }
     
    210210
    211211        if (temp)
    212             this->destroy();
     212            delete this;
    213213    }
    214214
  • code/trunk/src/libraries/tools/Timer.h

    r9667 r11018  
    7979#include "tools/ToolsPrereqs.h"
    8080
    81 #include "core/class/OrxonoxClass.h"
     81#include "core/object/Listable.h"
    8282#include "core/command/ExecutorPtr.h"
    8383
     
    102102        on the game time.
    103103    */
    104     class _ToolsExport Timer : public OrxonoxClass
     104    class _ToolsExport Timer : public Listable
    105105    {
    106106        public:
  • code/trunk/src/modules/pong/PongAI.cc

    r10727 r11018  
    7878    {
    7979        for (std::list<std::pair<Timer*, char> >::iterator it = this->reactionTimers_.begin(); it != this->reactionTimers_.end(); ++it)
    80             it->first->destroy();
     80            delete it->first;
    8181    }
    8282
     
    380380
    381381        // Destroy the timer and remove it from the list
    382         Timer* timer = this->reactionTimers_.front().first;
    383         timer->destroy();
    384 
     382        delete this->reactionTimers_.front().first;
    385383        this->reactionTimers_.pop_front();
    386384    }
  • code/trunk/src/orxonox/worldentities/MovableEntity.cc

    r10216 r11018  
    6161        if (this->isInitialized())
    6262            if (this->continuousResynchroTimer_)
    63                 this->continuousResynchroTimer_->destroy();
     63                delete this->continuousResynchroTimer_;
    6464    }
    6565
Note: See TracChangeset for help on using the changeset viewer.