Implemented proper memory cleanup when deleting FileData objects.

This fixes a memory leak which was most prominent during application shutdown.
This commit is contained in:
Leon Styhre 2020-10-17 17:35:50 +02:00
parent 35c7c7ec09
commit da37e2c11a

View file

@ -68,13 +68,14 @@ FileData::FileData(
FileData::~FileData()
{
if (mParent)
mParent->removeChild(this);
if (mType == GAME)
mSystem->getIndex()->removeFromIndex(this);
mChildren.clear();
if (mParent)
mParent->removeChild(this);
while (mChildren.size() > 0)
delete (mChildren.front());
}
std::string FileData::getDisplayName() const