From 04626b089126c67237a579c943d2d36d9ff53f8a Mon Sep 17 00:00:00 2001 From: Jan Mulder Date: Sun, 7 Jan 2018 10:53:13 +0100 Subject: Fix small memory leak When deleting a dive from the divelist model, also free the pointed to DiveObjectHelper data. There seems no harm done (other than a memory leak) by this missing free. Found while (again) investigating the infamous crash occuring when deleting a dive from the mobile app when deleting a dive from the dive list. Signed-off-by: Jan Mulder --- qt-models/divelistmodel.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/qt-models/divelistmodel.cpp b/qt-models/divelistmodel.cpp index ba99e47bb..b28bd58a3 100644 --- a/qt-models/divelistmodel.cpp +++ b/qt-models/divelistmodel.cpp @@ -76,6 +76,7 @@ void DiveListModel::insertDive(int i, DiveObjectHelper *newDive) void DiveListModel::removeDive(int i) { beginRemoveRows(QModelIndex(), i, i); + delete m_dives.at(i); m_dives.removeAt(i); endRemoveRows(); } -- cgit v1.2.3-70-g09d2