- Timestamp:
- Aug 25, 2010, 11:46:32 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/consolecommands3/src/libraries/core/command/ConsoleCommand.cc
r7216 r7218 93 93 bool _ConsoleCommand::isActive() const 94 94 { 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())); 96 96 } 97 97 … … 154 154 if (this->executor_) 155 155 this->executor_->setFunctor(functor); 156 else 156 else if (functor) 157 157 this->executor_ = createExecutor(functor); 158 158 … … 208 208 if (command.executor_) 209 209 this->executor_->setFunctor(command.functor_); 210 } 211 212 void _ConsoleCommand::resetFunction() 213 { 214 if (this->executor_) 215 this->executor_->setFunctor(0); 210 216 } 211 217 … … 453 459 /* static */ void _ConsoleCommand::destroyAll() 454 460 { 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; 457 463 } 458 464 }
Note: See TracChangeset
for help on using the changeset viewer.