From 3bbf303403550e4e6f48b8778982d248651449ee Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Mon, 11 Dec 2017 15:47:49 +0100 Subject: Check the context matcher for isDestroyed() before assigning it Some code "resets" a custom context matcher on destruction. As destruction order of global objects is not defined, that may be after the context matcher has already been destroyed. Change-Id: I1d3869cb393c490ddb70b71a2d93578a03e2af79 Reviewed-by: Simon Hausmann Reviewed-by: J-P Nurmi --- src/quick/util/qquickshortcut.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/quick/util') diff --git a/src/quick/util/qquickshortcut.cpp b/src/quick/util/qquickshortcut.cpp index 58f7fc8439..78dc855326 100644 --- a/src/quick/util/qquickshortcut.cpp +++ b/src/quick/util/qquickshortcut.cpp @@ -122,7 +122,8 @@ Q_QUICK_PRIVATE_EXPORT ContextMatcher qt_quick_shortcut_context_matcher() Q_QUICK_PRIVATE_EXPORT void qt_quick_set_shortcut_context_matcher(ContextMatcher matcher) { - *ctxMatcher() = matcher; + if (!ctxMatcher.isDestroyed()) + *ctxMatcher() = matcher; } QT_BEGIN_NAMESPACE -- cgit v1.2.3