diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-03-15 14:07:43 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-03-16 07:59:21 +0000 |
commit | ce5b33c350cb7aa4a649088d85e48be08b632b69 (patch) | |
tree | ca638cc4b44923650cef76125268eb47f66a364e | |
parent | a8766caf09132bc08b7bc7eb3200607e2175d89d (diff) |
Avoid crashes when the qquickcontrols2 plugin gets unloaded
The styleSpec() can be a nullptr in some cases, so test for that
before calling reset() on it.
Fixes a crash on exit in the qqmlextensionsplugin autotest of
qtdeclarative if qtquickcontrols2 has been compiled.
Change-Id: Ic43cbec57b36f9a0181d3b0c50d4a19236b5870e
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
-rw-r--r-- | src/quickcontrols2/qquickstyle.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/quickcontrols2/qquickstyle.cpp b/src/quickcontrols2/qquickstyle.cpp index daa48144..3831259b 100644 --- a/src/quickcontrols2/qquickstyle.cpp +++ b/src/quickcontrols2/qquickstyle.cpp @@ -310,7 +310,8 @@ void QQuickStylePrivate::init(const QUrl &baseUrl) void QQuickStylePrivate::reset() { - styleSpec()->reset(); + if (styleSpec()) + styleSpec()->reset(); } QString QQuickStylePrivate::configFilePath() |