From: Soeren Apel Date: Tue, 23 Jun 2020 18:31:10 +0000 (+0200) Subject: TabularDecView: Try to handle a race condition in the model X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=commitdiff_plain;h=4d0f333acdcd747ffc542d77e679ce08af6031ae TabularDecView: Try to handle a race condition in the model --- diff --git a/pv/views/tabular_decoder/model.cpp b/pv/views/tabular_decoder/model.cpp index 110cfd62..b87bf058 100644 --- a/pv/views/tabular_decoder/model.cpp +++ b/pv/views/tabular_decoder/model.cpp @@ -324,9 +324,9 @@ QModelIndex AnnotationCollectionModel::update_highlighted_rows(QModelIndex first // we would need to highlight - only then do we do so QModelIndex index = first; do { - const Annotation* ann = - static_cast(index.internalPointer()); - assert(ann); + const Annotation* ann = static_cast(index.internalPointer()); + if (!ann) // Can happen if the table is being modified at this exact time + return result; if (((int64_t)ann->start_sample() <= sample_num) && ((int64_t)ann->end_sample() >= sample_num)) {