Changeset 10520
- Timestamp:
- May 31, 2015, 11:54:06 AM (10 years ago)
- Location:
- code/branches/core7/src
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core7/src/libraries/core/Core.cc
r10518 r10520 241 241 safeObjectDelete(&languageInstance_); 242 242 safeObjectDelete(&configFileManager_); 243 ConsoleCommandManager::getInstance().destroyAll();244 243 Context::setRootContext(NULL); 245 IdentifierManager::getInstance().destroyAllIdentifiers();246 244 safeObjectDelete(&signalHandler_); 247 245 // if (this->rootModule_) -
code/branches/core7/src/libraries/core/CoreIncludes.h
r10512 r10520 226 226 public: 227 227 StaticallyInitializedIdentifier(Identifier* identifier) : identifier_(identifier) {} 228 ~StaticallyInitializedIdentifier() { delete identifier_; } 228 229 229 230 virtual void load() -
code/branches/core7/src/libraries/core/class/IdentifierManager.cc
r10519 r10520 277 277 this->identifierByNetworkId_.clear(); 278 278 } 279 280 /**281 @brief Destroys all Identifiers. Called when exiting the program.282 */283 void IdentifierManager::destroyAllIdentifiers()284 {285 for (std::set<Identifier*>::iterator it = this->identifiers_.begin(); it != this->identifiers_.end(); ++it)286 delete (*it);287 288 this->identifiers_.clear();289 this->identifierByString_.clear();290 this->identifierByLowercaseString_.clear();291 this->identifierByNetworkId_.clear();292 }293 279 } -
code/branches/core7/src/libraries/core/class/IdentifierManager.h
r10519 r10520 87 87 { return this->identifierByNetworkId_; } 88 88 89 void destroyAllIdentifiers();90 91 89 private: 92 90 IdentifierManager(); -
code/branches/core7/src/libraries/core/command/ConsoleCommand.cc
r10484 r10520 92 92 ConsoleCommand::~ConsoleCommand() 93 93 { 94 ConsoleCommandManager::getInstance().unregisterCommand(this);95 94 } 96 95 -
code/branches/core7/src/libraries/core/command/ConsoleCommandIncludes.h
r10484 r10520 311 311 public: 312 312 StaticallyInitializedConsoleCommand(ConsoleCommand* command) : command_(command) {} 313 ~StaticallyInitializedConsoleCommand() { delete command_; } 313 314 314 315 virtual void load(); -
code/branches/core7/src/libraries/core/command/ConsoleCommandManager.cc
r10484 r10520 191 191 } 192 192 } 193 194 /**195 @brief Deletes all commands196 */197 void ConsoleCommandManager::destroyAll()198 {199 // delete entries until the map is empty200 while (!this->commandMap_.empty() && !this->commandMap_.begin()->second.empty())201 delete this->commandMap_.begin()->second.begin()->second;202 }203 193 } -
code/branches/core7/src/libraries/core/command/ConsoleCommandManager.h
r10484 r10520 68 68 ConsoleCommand* getCommandLC(const std::string& group, const std::string& name, bool bPrintError = false); 69 69 70 void destroyAll();71 72 70 private: 73 71 std::map<std::string, std::map<std::string, ConsoleCommand*> > commandMap_; -
code/branches/core7/src/libraries/core/commandline/CommandLineIncludes.h
r10404 r10520 59 59 public: 60 60 StaticallyInitializedCommandLineArgument(CommandLineArgument* argument) : argument_(argument) {} 61 ~StaticallyInitializedCommandLineArgument() { delete argument_; } 61 62 62 63 virtual void load() -
code/branches/core7/src/libraries/core/commandline/CommandLineParser.cc
r10509 r10520 85 85 CommandLineParser::~CommandLineParser() 86 86 { 87 CommandLineParser::destroyAllArguments();88 87 } 89 88 … … 96 95 static CommandLineParser instance; 97 96 return instance; 98 }99 100 /**101 @brief102 Destroys all command line arguments. This should be called at the end103 of main. Do not use before that.104 */105 void CommandLineParser::destroyAllArguments()106 {107 for (std::map<std::string, CommandLineArgument*>::const_iterator it = _getInstance().cmdLineArgs_.begin();108 it != _getInstance().cmdLineArgs_.end(); ++it)109 delete it->second;110 _getInstance().cmdLineArgs_.clear();111 97 } 112 98 -
code/branches/core7/src/libraries/core/commandline/CommandLineParser.h
r10404 r10520 161 161 } 162 162 163 static void destroyAllArguments();164 165 163 static void generateDoc(std::ofstream& file); 166 164 -
code/branches/core7/src/libraries/core/singleton/ScopedSingletonIncludes.h
r10514 r10520 84 84 , scope_(scope) 85 85 {} 86 ~StaticallyInitializedScopedSingletonWrapper() { delete wrapper_; } 86 87 87 88 virtual void load(); -
code/branches/core7/src/libraries/network/NetworkFunctionIncludes.h
r10478 r10520 52 52 public: 53 53 StaticallyInitializedNetworkFunction(NetworkFunctionBase* function) : function_(function) {} 54 ~StaticallyInitializedNetworkFunction() { delete function_; } 54 55 55 56 virtual void load(); -
code/branches/core7/src/libraries/network/NetworkFunctionManager.cc
r10475 r10520 54 54 } 55 55 56 void NetworkFunctionManager::destroyAllNetworkFunctions()57 {58 std::set<NetworkFunctionBase*>::iterator it;59 for (it = this->functions_.begin(); it != this->functions_.end(); ++it)60 delete (*it);61 }62 63 56 NetworkFunctionBase* NetworkFunctionManager::getFunctionByName(const std::string& name) 64 57 { -
code/branches/core7/src/libraries/network/NetworkFunctionManager.h
r10475 r10520 46 46 void unregisterFunction(NetworkFunctionBase* function); 47 47 48 void destroyAllNetworkFunctions();49 50 48 inline const std::set<NetworkFunctionBase*>& getAllFunctions() 51 49 { return functions_; } -
code/branches/core7/src/orxonox/gamestates/GSRoot.cc
r10474 r10520 35 35 #include "core/command/ConsoleCommandIncludes.h" 36 36 #include "network/NetworkFunctionIncludes.h" 37 #include "network/NetworkFunctionManager.h"38 37 #include "tools/Timer.h" 39 38 #include "tools/interfaces/Tickable.h" … … 69 68 GSRoot::~GSRoot() 70 69 { 71 NetworkFunctionManager::getInstance().destroyAllNetworkFunctions();72 70 } 73 71
Note: See TracChangeset
for help on using the changeset viewer.