Changeset 97d564e in subsurface


Ignore:
Timestamp:
Dec 28, 2017, 8:30:13 AM (4 weeks ago)
Author:
Jan Mulder <jlmulder@…>
Branches:
master
Children:
522b922
Parents:
c032006
git-author:
Jan Mulder <jlmulder@…> (12/26/17 23:45:36)
git-committer:
Jan Mulder <jlmulder@…> (12/28/17 08:30:13)
Message:

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@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • qt-models/filtermodels.cpp

    rc3b1c64 r97d564e  
    441441        divesDisplayed = 0;
    442442
    443         invalidate();
     443        invalidateFilter();
    444444
    445445        // first make sure the trips are no longer shown as selected
Note: See TracChangeset for help on using the changeset viewer.