diff options
author | Jan Mulder <jlmulder@xs4all.nl> | 2017-12-27 08:45:36 +0100 |
---|---|---|
committer | Jan Mulder <jlmulder@xs4all.nl> | 2017-12-28 17:30:13 +0100 |
commit | 97d564e92041ffb1997b76d6db7f0be612f9a29b (patch) | |
tree | a6a34c9c446055325c774199210c3478f0e1e001 /qt-models | |
parent | c032006d91ee3cce7d9267ff9a1c39ac7087d272 (diff) | |
download | subsurface-97d564e92041ffb1997b76d6db7f0be612f9a29b.tar.gz |
filter: prevent assert trap on exit filters
This "bug" is found using Qt 5.10 compiled in developer mode. Access
the filers, click a little around here, close the filters. Almost every
time the following assert is triggered:
ASSERT failure in QPersistentModelIndex::~QPersistentModelIndex:
"persistent model indexes corrupted", file itemmodels/qabstractitemmodel.cpp, line 643
This is relatively deep down in Qt, and it is triggered by clearing the
filters. Trying to force a crash when using the same scenario in Qt 5.10
compiled for production (so no active asserts) did not result in a crash.
So, upto this time, it is unclear if the Qt assert points out a real problem,
or it is some false alarm (for whatever reason).
Further investigation shows that the assert can be solved by changing the
invalidate() to an invalidateFilter(). Indeed, the last variant is a little
more lightweigt, and does seem to do the same job from a functional point
of view (in this case).
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Diffstat (limited to 'qt-models')
-rw-r--r-- | qt-models/filtermodels.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/qt-models/filtermodels.cpp b/qt-models/filtermodels.cpp index cb83ce946..f84b5335c 100644 --- a/qt-models/filtermodels.cpp +++ b/qt-models/filtermodels.cpp @@ -440,7 +440,7 @@ void MultiFilterSortModel::myInvalidate() divesDisplayed = 0; - invalidate(); + invalidateFilter(); // first make sure the trips are no longer shown as selected // (but without updating the selection state of the dives... this just cleans |