- Timestamp:
- Oct 7, 2005, 10:42:22 AM (19 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/coord/p_node.cc
r5255 r5296 74 74 75 75 /** 76 * standard deconstructor 77 */ 76 * standard deconstructor 77 * 78 * There are two general ways to delete a PNode 79 * 1. delete instance; 80 * -> result 81 * delete this Node and all its children and children's children... 82 * (danger if you still need the children's instance somewhere else!!) 83 * 84 * 2. instance->remove2D(); delete instance; 85 * -> result: 86 * moves its children to the NullParent 87 * then deletes the Element. 88 */ 78 89 PNode::~PNode () 79 90 { 80 if (this->parent) 81 this->parent->removeChild(this); 82 else 83 { 84 tIterator<PNode>* iterator = this->children->getIterator(); 85 PNode* pn = iterator->firstElement(); 86 while( pn != NULL) 87 { 88 delete pn; 89 pn = iterator->nextElement(); 90 } 91 delete iterator; 92 /* this deletes all children in the list */ 91 // remove the Node, delete it's children. 92 tIterator<PNode>* iterator = this->children->getIterator(); 93 PNode* child = iterator->firstElement(); 94 95 while( child != NULL) 96 { 97 delete child; 98 child = iterator->nextElement(); 99 } 100 delete iterator; 101 102 if (this->parent != NULL) 103 { 104 this->parent->children->remove(this); 105 this->parent = NULL; 93 106 } 94 107 delete this->children; 108 109 // remove all other allocated memory. 95 110 if (this->toCoordinate != NULL) 96 111 delete this->toCoordinate; … … 98 113 delete this->toDirection; 99 114 } 115 100 116 101 117 /** -
trunk/src/story_entities/world.cc
r5294 r5296 128 128 129 129 130 // delete all the initialized Engines. 130 131 delete LightManager::getInstance(); 131 132 delete TrackManager::getInstance(); 132 133 delete ParticleEngine::getInstance(); 133 delete AnimationPlayer::getInstance(); // this should be at the end of the unloading sequence.134 delete AnimationPlayer::getInstance(); 134 135 delete PhysicsEngine::getInstance(); 135 136 … … 142 143 // erease everything that is left. 143 144 delete NullParent::getInstance(); 144 delete NullParent::getInstance();145 145 146 146 // unload the resources !! 147 147 ResourceManager::getInstance()->unloadAllByPriority(RP_LEVEL); 148 149 150 EventHandler::getInstance()->debug();151 ClassList::debug(CL_PARENT_NODE, 3);152 // exit(-1);153 148 154 149 delete[] this->path;
Note: See TracChangeset
for help on using the changeset viewer.