Changeset 7399 in orxonox.OLD for trunk/src/lib
- Timestamp:
- Apr 27, 2006, 4:33:17 PM (19 years ago)
- Location:
- trunk/src/lib/shell
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/shell/shell_command.cc
r7398 r7399 51 51 this->shellClass = ShellCommandClass::getCommandClass(className); 52 52 assert (this->shellClass != NULL); 53 this->shellClass-> commandList.push_back(this);53 this->shellClass->registerCommand(this); 54 54 } 55 55 … … 59 59 ShellCommand::~ShellCommand() 60 60 { 61 this->shellClass->unregisterCommand(this); 61 62 if (this->alias != NULL) 62 63 delete this->alias; … … 83 84 void ShellCommand::unregisterCommand(const std::string& commandName, const std::string& className) 84 85 { 85 /// FIXME 86 /* if (ShellCommandClass::commandClassList == NULL) 87 ShellCommandClass::initCommandClassList(); 88 89 const ShellCommandClass* checkClass = ShellCommandClass::isRegistered(className); 90 91 if (checkClass != NULL) 92 { 93 std::list<ShellCommand*>::iterator elem; 94 for (elem = checkClass->commandList.begin(); elem != checkClass->commandList.end(); elem++) 95 { 96 if (!strcmp(commandName, (*elem)->getName())) 97 { 98 delete (*elem); 99 checkClass->commandList.remove(*elem); 100 break; 101 } 102 } 103 104 if (checkClass->commandList->size() == 0) 105 { 106 ShellCommandClass::commandClassList->remove(checkClass); 107 delete checkClass; 108 } 109 }*/ 86 87 ShellCommandClass* cmdClass = ShellCommandClass::getCommandClass(className); 88 if (cmdClass != NULL) 89 { 90 std::vector<ShellCommand*>::iterator cmd; 91 for (cmd = cmdClass->commandList.begin(); cmd < cmdClass->commandList.end(); cmd++) 92 { 93 if (commandName == (*cmd)->getName()) 94 { 95 delete (*cmd); 96 } 97 } 98 } 110 99 } 111 100 -
trunk/src/lib/shell/shell_command_class.cc
r7394 r7399 49 49 { 50 50 while(!this->commandList.empty()) 51 {52 51 delete this->commandList.back(); 53 this->commandList.pop_back();54 }55 52 } 56 53
Note: See TracChangeset
for help on using the changeset viewer.