summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@qt.io>2016-12-16 15:02:30 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2016-12-17 11:46:17 +0000
commitf191297cef751ab55d069fc21284536ceae4ba61 (patch)
treead3fb0cb03806269031d27924eedc89f11befe68
parentd92de30c7c9d56bbbc6f886d8e0a0efce517be60 (diff)
Fix crash on charts initialization when useOpenGL is setv5.8.0-rc1
In some common QML use cases, presenter can be null in XYChart::refreshGlChart(), leading to a crash. Task-number: QTBUG-57680 Change-Id: I41c7980adfe097039f09d75acfcb213740d50f72 Reviewed-by: Mika Salmela <mika.salmela@qt.io> Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
-rw-r--r--src/charts/xychart/xychart.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/charts/xychart/xychart.cpp b/src/charts/xychart/xychart.cpp
index 4314f6dd..a6432fd7 100644
--- a/src/charts/xychart/xychart.cpp
+++ b/src/charts/xychart/xychart.cpp
@@ -131,7 +131,8 @@ void XYChart::updateGlChart()
// Doesn't update gl geometry, but refreshes the chart
void XYChart::refreshGlChart()
{
- presenter()->updateGLWidget();
+ if (presenter())
+ presenter()->updateGLWidget();
}
//handlers