summaryrefslogtreecommitdiffstats
path: root/src/charts/chartpresenter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/charts/chartpresenter.cpp')
-rw-r--r--src/charts/chartpresenter.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/charts/chartpresenter.cpp b/src/charts/chartpresenter.cpp
index e6d38db7..d9b1f03d 100644
--- a/src/charts/chartpresenter.cpp
+++ b/src/charts/chartpresenter.cpp
@@ -562,6 +562,11 @@ void ChartPresenter::updateGLWidget()
#ifndef QT_NO_OPENGL
// GLWidget pointer is wrapped in QPointer as its parent is not in our control, and therefore
// can potentially get deleted unexpectedly.
+ if (!m_glWidget.isNull() && m_glWidget->needsReset()) {
+ m_glWidget->hide();
+ delete m_glWidget.data();
+ m_glWidget.clear();
+ }
if (m_glWidget.isNull() && m_glUseWidget && m_chart->scene()) {
// Find the view of the scene. If the scene has multiple views, only the first view is
// chosen.