mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-01-29 19:55:37 +00:00
Fixed two memory leaks in CollectionSystemManager.
This commit is contained in:
parent
2eb5125d0e
commit
ca696e75cd
|
@ -90,7 +90,7 @@ CollectionSystemManager::~CollectionSystemManager()
|
||||||
if (SystemData::sSystemVector.size() > 0)
|
if (SystemData::sSystemVector.size() > 0)
|
||||||
removeCollectionsFromDisplayedSystems();
|
removeCollectionsFromDisplayedSystems();
|
||||||
|
|
||||||
// Iterate the map.
|
// Save and delete all custom collections.
|
||||||
for (std::map<std::string, CollectionSystemData>::const_iterator
|
for (std::map<std::string, CollectionSystemData>::const_iterator
|
||||||
it = mCustomCollectionSystemsData.cbegin();
|
it = mCustomCollectionSystemsData.cbegin();
|
||||||
it != mCustomCollectionSystemsData.cend() ; it++) {
|
it != mCustomCollectionSystemsData.cend() ; it++) {
|
||||||
|
@ -99,12 +99,17 @@ CollectionSystemManager::~CollectionSystemManager()
|
||||||
delete it->second.system;
|
delete it->second.system;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Delete the custom collections bundle.
|
||||||
|
if (mCustomCollectionsBundle)
|
||||||
|
delete mCustomCollectionsBundle;
|
||||||
|
|
||||||
// Delete the auto collections systems.
|
// Delete the auto collections systems.
|
||||||
for (auto it = mAutoCollectionSystemsData.cbegin();
|
for (auto it = mAutoCollectionSystemsData.cbegin();
|
||||||
it != mAutoCollectionSystemsData.cend(); it++) {
|
it != mAutoCollectionSystemsData.cend(); it++) {
|
||||||
delete (*it).second.system;
|
delete (*it).second.system;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
delete mCollectionEnvData;
|
||||||
sInstance = nullptr;
|
sInstance = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue