mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-02-18 04:45:39 +00:00
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:
parent
35c7c7ec09
commit
da37e2c11a
|
@ -68,13 +68,14 @@ FileData::FileData(
|
||||||
|
|
||||||
FileData::~FileData()
|
FileData::~FileData()
|
||||||
{
|
{
|
||||||
if (mParent)
|
|
||||||
mParent->removeChild(this);
|
|
||||||
|
|
||||||
if (mType == GAME)
|
if (mType == GAME)
|
||||||
mSystem->getIndex()->removeFromIndex(this);
|
mSystem->getIndex()->removeFromIndex(this);
|
||||||
|
|
||||||
mChildren.clear();
|
if (mParent)
|
||||||
|
mParent->removeChild(this);
|
||||||
|
|
||||||
|
while (mChildren.size() > 0)
|
||||||
|
delete (mChildren.front());
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string FileData::getDisplayName() const
|
std::string FileData::getDisplayName() const
|
||||||
|
|
Loading…
Reference in a new issue