mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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 <jlmulder@xs4all.nl>
This commit is contained in:
parent
e5980942aa
commit
04626b0891
1 changed files with 1 additions and 0 deletions
|
@ -76,6 +76,7 @@ void DiveListModel::insertDive(int i, DiveObjectHelper *newDive)
|
||||||
void DiveListModel::removeDive(int i)
|
void DiveListModel::removeDive(int i)
|
||||||
{
|
{
|
||||||
beginRemoveRows(QModelIndex(), i, i);
|
beginRemoveRows(QModelIndex(), i, i);
|
||||||
|
delete m_dives.at(i);
|
||||||
m_dives.removeAt(i);
|
m_dives.removeAt(i);
|
||||||
endRemoveRows();
|
endRemoveRows();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue