From a64421fb9106994c7d59715f3a63eaab47806a82 Mon Sep 17 00:00:00 2001 From: heckflosse Date: Wed, 7 Jun 2017 23:11:06 +0200 Subject: [PATCH] Fix small memory leak --- rtgui/profilepanel.cc | 5 +++-- rtgui/profilepanel.h | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/rtgui/profilepanel.cc b/rtgui/profilepanel.cc index 06768cf56..7738e5ded 100644 --- a/rtgui/profilepanel.cc +++ b/rtgui/profilepanel.cc @@ -39,7 +39,7 @@ void ProfilePanel::cleanup () delete partialProfileDlg; } -ProfilePanel::ProfilePanel () : storedPProfile(nullptr), lastFilename(""), imagePath("") +ProfilePanel::ProfilePanel () : storedPProfile(nullptr), lastFilename(""), imagePath(""), lastSavedPSE(nullptr) { tpc = nullptr; @@ -128,6 +128,7 @@ ProfilePanel::~ProfilePanel () delete profileFillModeOnImage; delete profileFillModeOffImage; + delete lastSavedPSE; } bool ProfilePanel::isCustomSelected() @@ -171,7 +172,7 @@ Gtk::TreeIter ProfilePanel::addCustomRow() Gtk::TreeIter ProfilePanel::addLastSavedRow() { - const ProfileStoreEntry *lastSavedPSE = new ProfileStoreEntry(Glib::ustring ("(" + M("PROFILEPANEL_PLASTSAVED") + ")"), PSET_FILE, 0, 0); + lastSavedPSE = new ProfileStoreEntry(Glib::ustring ("(" + M("PROFILEPANEL_PLASTSAVED") + ")"), PSET_FILE, 0, 0); Gtk::TreeIter newEntry = profiles->addRow(lastSavedPSE); return newEntry; } diff --git a/rtgui/profilepanel.h b/rtgui/profilepanel.h index 72c9db36b..fb3fa0a18 100644 --- a/rtgui/profilepanel.h +++ b/rtgui/profilepanel.h @@ -42,6 +42,7 @@ private: RTImage *profileFillModeOffImage; Gtk::ToggleButton* fillMode; Gtk::TreeIter currRow; + ProfileStoreEntry *lastSavedPSE; void profileFillModeToggled (); bool isCustomSelected ();