diff --git a/rtengine/iccstore.cc b/rtengine/iccstore.cc index 58c05665f..47bfadd80 100644 --- a/rtengine/iccstore.cc +++ b/rtengine/iccstore.cc @@ -293,6 +293,12 @@ public: cmsCloseProfile(p.second); } } + if(srgb) { + cmsCloseProfile(srgb); + } + if(xyz) { + cmsCloseProfile(xyz); + } } void init(const Glib::ustring& usrICCDir, const Glib::ustring& rtICCDir, bool loadAll) diff --git a/rtengine/profilestore.cc b/rtengine/profilestore.cc index 12c1cca5c..75e916808 100644 --- a/rtengine/profilestore.cc +++ b/rtengine/profilestore.cc @@ -248,6 +248,8 @@ bool ProfileStore::parseDir (Glib::ustring& realPath, Glib::ustring& virtualPath if (!fileFound && (level > 0 || displayLevel0)) { // no files found in this level, we delete the subdirectory entry folders.pop_back(); + + delete entries.back(); entries.pop_back(); }