diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2019-11-26 23:41:56 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-11-26 17:21:34 -0800 |
commit | ddfc384b61b5990a54a5b0613a39c3ffb4ac23f4 (patch) | |
tree | fce5ed9de3c5a76e8e5671c81cda724bce504f4f /qt-models/weightmodel.cpp | |
parent | 7eda75d7abb0c0b42e8d71bcfcb4bc09c22ce300 (diff) | |
download | subsurface-ddfc384b61b5990a54a5b0613a39c3ffb4ac23f4.tar.gz |
Cylinders: Fix crash when removing cylinders
Change the remove() function of the cylinder and weight models
to take the index by value. The code used to take it by reference
and the reference would be invalidated when removing rows from
the model!
Reported-by: Gaetan Bisson <bisson@archlinux.org>
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'qt-models/weightmodel.cpp')
-rw-r--r-- | qt-models/weightmodel.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/qt-models/weightmodel.cpp b/qt-models/weightmodel.cpp index 3b5a122bf..36971f12e 100644 --- a/qt-models/weightmodel.cpp +++ b/qt-models/weightmodel.cpp @@ -21,7 +21,7 @@ weightsystem_t *WeightModel::weightSystemAt(const QModelIndex &index) return &displayed_dive.weightsystems.weightsystems[index.row()]; } -void WeightModel::remove(const QModelIndex &index) +void WeightModel::remove(QModelIndex index) { if (index.column() != REMOVE) return; |