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/cylindermodel.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/cylindermodel.cpp')
-rw-r--r-- | qt-models/cylindermodel.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/qt-models/cylindermodel.cpp b/qt-models/cylindermodel.cpp index 22fc5ae8b..5d697470f 100644 --- a/qt-models/cylindermodel.cpp +++ b/qt-models/cylindermodel.cpp @@ -486,7 +486,7 @@ Qt::ItemFlags CylindersModel::flags(const QModelIndex &index) const return QAbstractItemModel::flags(index) | Qt::ItemIsEditable; } -void CylindersModel::remove(const QModelIndex &index) +void CylindersModel::remove(QModelIndex index) { if (index.column() == USE) { |