aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Keller <Rainer.Keller@qt.io>2022-10-18 13:43:03 +0200
committerRainer Keller <Rainer.Keller@qt.io>2022-10-24 10:49:40 +0000
commita62155d98a35c9658dc9f8c4f9a309ddddc2bf0a (patch)
tree377b16582a45cbfc7f6e3ff957d98c44789bffae
parent50a5ceeaaf5de023e4e3c85c6d8a79a168279152 (diff)
McuSupport: Fix crash
The function updateStatusUi is modifying children of the main widget. In case the package changes when the MCU dialog is not present anymore it tries to access invalid widget pointers. Change-Id: I9127114caf03b4ea047b075e875f20bb3e0c02b4 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
-rw-r--r--src/plugins/mcusupport/mcupackage.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/mcusupport/mcupackage.cpp b/src/plugins/mcusupport/mcupackage.cpp
index 67b5f2091a1..051ce8d642e 100644
--- a/src/plugins/mcusupport/mcupackage.cpp
+++ b/src/plugins/mcusupport/mcupackage.cpp
@@ -259,7 +259,7 @@ QWidget *McuPackage::widget()
m_fileChooser->setFilePath(m_path);
- QObject::connect(this, &McuPackage::statusChanged, this, [this] { updateStatusUi(); });
+ QObject::connect(this, &McuPackage::statusChanged, widget, [this] { updateStatusUi(); });
QObject::connect(m_fileChooser, &PathChooser::textChanged, this, [this] {
updatePath();