From ca696e75cde01d5f29b8a5cf86984b878854cfc4 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Sun, 18 Oct 2020 22:28:18 +0200 Subject: [PATCH] Fixed two memory leaks in CollectionSystemManager. --- es-app/src/CollectionSystemManager.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/es-app/src/CollectionSystemManager.cpp b/es-app/src/CollectionSystemManager.cpp index 49d9295e0..b5b7384ef 100644 --- a/es-app/src/CollectionSystemManager.cpp +++ b/es-app/src/CollectionSystemManager.cpp @@ -90,7 +90,7 @@ CollectionSystemManager::~CollectionSystemManager() if (SystemData::sSystemVector.size() > 0) removeCollectionsFromDisplayedSystems(); - // Iterate the map. + // Save and delete all custom collections. for (std::map::const_iterator it = mCustomCollectionSystemsData.cbegin(); it != mCustomCollectionSystemsData.cend() ; it++) { @@ -99,12 +99,17 @@ CollectionSystemManager::~CollectionSystemManager() delete it->second.system; } + // Delete the custom collections bundle. + if (mCustomCollectionsBundle) + delete mCustomCollectionsBundle; + // Delete the auto collections systems. for (auto it = mAutoCollectionSystemsData.cbegin(); it != mAutoCollectionSystemsData.cend(); it++) { delete (*it).second.system; } + delete mCollectionEnvData; sInstance = nullptr; }