aboutsummaryrefslogtreecommitdiffstats
path: root/plugin
diff options
context:
space:
mode:
authorGrigorii Zimin <gzimin@luxoft.com>2020-02-21 11:37:05 +0300
committerGrigorii Zimin <gzimin@luxoft.com>2020-02-21 09:23:09 +0000
commitc546a8fab7dcd54353b1d8f427a3508b5caf32e9 (patch)
treef0e2d1a5d9dde01a480eec6c1abe8adf60b25756 /plugin
parent50329e91428d434201ddb1d56ae4a4de33f13e2b (diff)
Fix UB which caused SEGFAULTHEADmaster
Fix CursorNavigationAttached destruction, which caused segfault when child instances called a method of the already deleted parent Fixes: AUTOSUITE-1485 Change-Id: Ib8937e28cdd79836954e488361b9bee3b2d9747c Reviewed-by: Egor Nemtsev <enemtsev@luxoft.com>
Diffstat (limited to 'plugin')
-rw-r--r--plugin/cursornavigationattached.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/plugin/cursornavigationattached.cpp b/plugin/cursornavigationattached.cpp
index 61ac5bd..c6a450f 100644
--- a/plugin/cursornavigationattached.cpp
+++ b/plugin/cursornavigationattached.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2018, 2019 Luxoft Sweden AB. All rights reserved.
+** Copyright (C) 2018 - 2020 Luxoft Sweden AB. All rights reserved.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the cursor management module of the Qt Toolkit.
@@ -67,6 +67,11 @@ m_escapeTarget(nullptr)
CursorNavigationAttached::~CursorNavigationAttached()
{
qCWarning(cursorNavigationLog) << "~CursorNavigationAttached";
+
+ for (auto && child: m_children) {
+ child->m_parentNavigable = nullptr;
+ }
+
if (m_cursorNavigation)
m_cursorNavigation->unregisterItem(this);
}