Changeset 10569
- Timestamp:
- Sep 8, 2015, 10:18:05 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core7/src/orxonox/gamestates/GSLevel.cc
r10566 r10569 47 47 48 48 #include "LevelManager.h" 49 #include "Level.h" 49 50 #include "PlayerManager.h" 50 51 #include "GSRoot.h" … … 214 215 void GSLevel::unloadLevelAsClient() 215 216 { 216 ObjectList<Synchronisable>::iterator it; 217 for(it = ObjectList<Synchronisable>::begin(); it; ) 218 { 219 if( it->getSyncMode() != 0x0 ) 217 for (ObjectList<Level>::iterator it = ObjectList<Level>::begin(); it != ObjectList<Level>::end(); ) 218 { 219 StrongPtr<Level> level = *(it++); // StrongPtr prevents that the Level gets destroyed while we loop over it 220 for (ObjectList<BaseObject>::iterator it = ObjectList<BaseObject>::begin(level); it != ObjectList<BaseObject>::end(level); ) 221 (it++)->destroy(); 222 } 223 224 for (ObjectList<Synchronisable>::iterator it = ObjectList<Synchronisable>::begin(); it != ObjectList<Synchronisable>::end(); ) 225 { 226 if (it->getSyncMode() != 0x0) 220 227 (it++)->destroy(); 221 228 else 222 {223 229 ++it; 224 }225 230 } 226 231 }
Note: See TracChangeset
for help on using the changeset viewer.