Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 25, 2010, 11:46:32 PM (14 years ago)
Author:
landauf
Message:

some improvements/fixes in ConsoleCommand

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/consolecommands3/src/libraries/core/command/ConsoleCommand.cc

    r7216 r7218  
    9393    bool _ConsoleCommand::isActive() const
    9494    {
    95         return (this->bActive_ && this->executor_ && this->executor_->getFunctor());
     95        return (this->bActive_ && this->executor_ && this->executor_->getFunctor() && (this->executor_->getFunctor()->getType() == Functor::Type::Static || this->executor_->getFunctor()->getRawObjectPointer()));
    9696    }
    9797
     
    154154            if (this->executor_)
    155155                this->executor_->setFunctor(functor);
    156             else
     156            else if (functor)
    157157                this->executor_ = createExecutor(functor);
    158158
     
    208208        if (command.executor_)
    209209            this->executor_->setFunctor(command.functor_);
     210    }
     211
     212    void _ConsoleCommand::resetFunction()
     213    {
     214        if (this->executor_)
     215            this->executor_->setFunctor(0);
    210216    }
    211217
     
    453459    /* static */ void _ConsoleCommand::destroyAll()
    454460    {
    455         while (!_ConsoleCommand::getCommandMap().empty() && !_ConsoleCommand::getCommandMap().begin().empty())
    456             _ConsoleCommand::getCommandMap().begin().erase(_ConsoleCommand::getCommandMap().begin().begin());
     461        while (!_ConsoleCommand::getCommandMap().empty() && !_ConsoleCommand::getCommandMap().begin()->second.empty())
     462            delete _ConsoleCommand::getCommandMap().begin()->second.begin()->second;
    457463    }
    458464}
Note: See TracChangeset for help on using the changeset viewer.