Fixed occasional crash in CRobotMain::DeleteAllObjects
parent
1b18b145cc
commit
6844b2170f
|
@ -1929,17 +1929,14 @@ void CRobotMain::DeleteAllObjects()
|
||||||
for (int i = 0; i < MAXSHOWLIMIT; i++)
|
for (int i = 0; i < MAXSHOWLIMIT; i++)
|
||||||
FlushShowLimit(i);
|
FlushShowLimit(i);
|
||||||
|
|
||||||
for(auto it : CObjectManager::GetInstancePointer()->GetAllObjects())
|
while(CObjectManager::GetInstancePointer()->GetAllObjects().size() > 0)
|
||||||
{
|
{
|
||||||
CObject* obj = it.second;
|
CObject* obj = CObjectManager::GetInstancePointer()->GetAllObjects().begin()->second;
|
||||||
|
|
||||||
if(obj != nullptr)
|
|
||||||
{
|
|
||||||
obj->DeleteObject(true); // destroys rapidly
|
obj->DeleteObject(true); // destroys rapidly
|
||||||
delete obj;
|
delete obj;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
//! Selects the human
|
//! Selects the human
|
||||||
void CRobotMain::SelectHuman()
|
void CRobotMain::SelectHuman()
|
||||||
|
|
Loading…
Reference in New Issue