Commit Graph
2 Commits
Author SHA1 Message Date
Magne Sjaastad 626d68ec59 Avoids iterator invalidation in QwtPlot item lists
When working with a summary ensemble in a Debug build on Windows, a crash happened in RiuQwtPlotWidget::resetPlotCurveHighlighting(). When iterating over list of plot items, one pointer to item pointed to 0xddddddd, a clear indication that the underlying list had been updated during the loop and the iterator invalidated.

The change ensures that modifications to the item list during iteration do not cause unexpected behavior, particularly in scenarios involving grid lines and curve highlighting.

This is achieved by making a copy of the item list before iteration when modifications may occur. For cases where no add/remove will be performed during the iteration, a comment is added to clarify that it is safe to access the reference to the list.
2025-11-10 14:58:55 +01:00
Magne Sjaastad f96374a6b4 2025.04.0 Merge dev into main 2025-04-07 12:21:57 +02:00