Fix: 2D crash when series is deleted after removeSeries()


Each renderer's afterPolish() was casting series pointers from the
cleanup list via qobject_cast, but the caller could delete the series
(via deleteLater() or delete) before the next polish event, leaving
dangling pointers in m_cleanupSeriesList.

Fix by adding seriesAboutToBeRemoved() to all renderers and calling it
synchronously from QGraphsView::removeSeries() while the pointer is
still valid. The renderer tears down its internal state immediately;
afterPolish() no longer touches series pointers. Also clear each
renderer's cleanup list in updatePolish() after afterPolish() runs to
prevent a second polish cycle from re-processing stale entries.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Pick-to: 6.12 6.11
Fixes: QTBUG-147540
Change-Id: I1cf784aba6843b0b133a0b9a6235a00f30764c51
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
commitc965e3990bc0f38b11c5a025531d9ca901111b25
parent2d9766952b7fe3952281b6fd580f3181e34ae7a5
authorSami Varanka <sami.varanka@qt.io>
committerVolker Hilsheimer <volker.hilsheimer@qt.io>
commit timeThu, 2 Jul 2026 13:18:31 +0000