diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2017-12-11 15:47:49 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2017-12-20 12:52:05 +0000 |
commit | 3bbf303403550e4e6f48b8778982d248651449ee (patch) | |
tree | c9e82b88263d2c33899e82c912a19b76a570c623 /src/quick/util/qquickshortcut.cpp | |
parent | 8a7e205eed38ff506d3768083047d1caf8481303 (diff) |
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 <simon.hausmann@qt.io>
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Diffstat (limited to 'src/quick/util/qquickshortcut.cpp')
-rw-r--r-- | src/quick/util/qquickshortcut.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
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 |