GLWidget: disconnect during destruction and cleanup


The GLWidget instance cleans up its data structures when the OpenGL
context is about to be destroyed, but the context might be destroyed as
part of destroying the GLWidget (typically when the QOpenGLWidget
destructor runs).
To prevent that the cleanup() function gets called after the GLWidget
destructor has run (which triggers the assert in QObject), disconnect
explicitly.

The crash reproduces with any of the tests using a QAbstractSeries
implementation when the useOpenGL property is set, so add a data-row
to one of them that provokes the assert without the fix.

Fixes: QTBUG-119900
Pick-to: 6.7 6.6 6.5
Change-Id: Ib4badd0c5df68ed60df6f492cada7954f0cb220a
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
commit5c4ddaae03e720cceb853a4d5574fa4755e66aad
parentd064dbf2d152302f319ed4a3afd784bb17d82ed2
authorVolker Hilsheimer <volker.hilsheimer@qt.io>
committerVolker Hilsheimer <volker.hilsheimer@qt.io>
commit timeTue, 12 Dec 2023 10:50:03 +0100