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>
This commit is contained in:
Rainer Keller
2022-10-18 13:43:03 +02:00
parent 50a5ceeaaf
commit a62155d98a

View File

@@ -259,7 +259,7 @@ QWidget *McuPackage::widget()
m_fileChooser->setFilePath(m_path); 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] { QObject::connect(m_fileChooser, &PathChooser::textChanged, this, [this] {
updatePath(); updatePath();