This is patch [#8232] Memory leak in KX_Scene destructor fixed
Submitted By: Benoit Bolsee (ben2610) Fixes a loop so that it removes objects properly from the scene. Kent
This commit is contained in:
@@ -171,12 +171,9 @@ KX_Scene::KX_Scene(class SCA_IInputDevice* keyboarddevice,
|
||||
KX_Scene::~KX_Scene()
|
||||
{
|
||||
|
||||
// int numobj = m_objectlist->GetCount();
|
||||
|
||||
//int numrootobjects = GetRootParentList()->GetCount();
|
||||
for (int i = 0; i < GetRootParentList()->GetCount(); i++)
|
||||
while (GetRootParentList()->GetCount() > 0)
|
||||
{
|
||||
KX_GameObject* parentobj = (KX_GameObject*) GetRootParentList()->GetValue(i);
|
||||
KX_GameObject* parentobj = (KX_GameObject*) GetRootParentList()->GetValue(0);
|
||||
this->RemoveObject(parentobj);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user