From a62155d98a35c9658dc9f8c4f9a309ddddc2bf0a Mon Sep 17 00:00:00 2001 From: Rainer Keller Date: Tue, 18 Oct 2022 13:43:03 +0200 Subject: [PATCH] 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: Reviewed-by: Christian Stenger --- src/plugins/mcusupport/mcupackage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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();