Fix small memory leak

This commit is contained in:
heckflosse
2017-06-07 23:11:06 +02:00
parent 5e5affa585
commit a64421fb91
2 changed files with 4 additions and 2 deletions

View File

@@ -39,7 +39,7 @@ void ProfilePanel::cleanup ()
delete partialProfileDlg; delete partialProfileDlg;
} }
ProfilePanel::ProfilePanel () : storedPProfile(nullptr), lastFilename(""), imagePath("") ProfilePanel::ProfilePanel () : storedPProfile(nullptr), lastFilename(""), imagePath(""), lastSavedPSE(nullptr)
{ {
tpc = nullptr; tpc = nullptr;
@@ -128,6 +128,7 @@ ProfilePanel::~ProfilePanel ()
delete profileFillModeOnImage; delete profileFillModeOnImage;
delete profileFillModeOffImage; delete profileFillModeOffImage;
delete lastSavedPSE;
} }
bool ProfilePanel::isCustomSelected() bool ProfilePanel::isCustomSelected()
@@ -171,7 +172,7 @@ Gtk::TreeIter ProfilePanel::addCustomRow()
Gtk::TreeIter ProfilePanel::addLastSavedRow() 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); Gtk::TreeIter newEntry = profiles->addRow(lastSavedPSE);
return newEntry; return newEntry;
} }

View File

@@ -42,6 +42,7 @@ private:
RTImage *profileFillModeOffImage; RTImage *profileFillModeOffImage;
Gtk::ToggleButton* fillMode; Gtk::ToggleButton* fillMode;
Gtk::TreeIter currRow; Gtk::TreeIter currRow;
ProfileStoreEntry *lastSavedPSE;
void profileFillModeToggled (); void profileFillModeToggled ();
bool isCustomSelected (); bool isCustomSelected ();