Changeset 2927 for code/trunk/src/core
- Timestamp:
- Apr 19, 2009, 10:59:59 PM (16 years ago)
- Location:
- code/trunk/src/core
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/core/Game.cc
r2896 r2927 106 106 delete this->core_; 107 107 108 // Delete all GameStates created by the macros109 for (std:: map<std::string, GameState*>::const_iterator it = allStates_s.begin(); it != allStates_s.end(); ++it)110 delete it->second;108 // Delete all the created nodes 109 for (std::vector<GameStateTreeNode*>::const_iterator it = this->allStateNodes_.begin(); it != this->allStateNodes_.end(); ++it) 110 delete *it; 111 111 112 112 delete this->gameClock_; … … 320 320 ThrowException(GameState, "No two root GameStates are allowed!"); 321 321 GameStateTreeNode* newNode = new GameStateTreeNode; 322 this->allStateNodes_.push_back(newNode); 322 323 newNode->state_ = newState; 323 324 newNode->parent_ = 0; … … 328 329 { 329 330 GameStateTreeNode* newNode = new GameStateTreeNode; 331 this->allStateNodes_.push_back(newNode); 330 332 newNode->state_ = newState; 331 333 if (newLevel < currentLevel) … … 391 393 return true; 392 394 } 395 396 /*static*/ void Game::destroyStates() 397 { 398 // Delete all GameStates created by the macros 399 for (std::map<std::string, GameState*>::const_iterator it = allStates_s.begin(); it != allStates_s.end(); ++it) 400 delete it->second; 401 allStates_s.clear(); 402 } 393 403 } -
code/trunk/src/core/Game.h
r2896 r2927 77 77 78 78 static bool addGameState(GameState* state); 79 static void destroyStates(); 79 80 static Game& getInstance() { assert(singletonRef_s); return *singletonRef_s; } 80 81 … … 95 96 GameStateTreeNode* activeStateNode_; 96 97 std::vector<GameStateTreeNode*> requestedStateNodes_; 98 std::vector<GameStateTreeNode*> allStateNodes_; 97 99 98 100 Core* core_;
Note: See TracChangeset
for help on using the changeset viewer.