From 81aed65406a0b379ed28c970bc8ddc29355aae09 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Thu, 30 May 2024 14:40:07 +0200 Subject: [PATCH] Meson: Fix crash after adding first meson/ninja tools - start Qt Creator without any meson or ninja tools registered (also not auto-detected) - add meson and ninja in the settings and apply - open kit settings and select a kit This would crash, because the constructor of the meson ToolKitAspectWidget saw that there was no tool registered and triggered setting the default tool. Doing that in the widget constructor results in an endless loop because changing the tool triggers an update of the kit which triggers an update of the ToolKitAspectWidget which doesn't exist yet (because the constructor didn't finish yet), so it would be created again which results in the same situation and endless recursion. Do not change the selected value in the widget constructor. This is the same logic as for the CMakeKitAspect(Impl). Fixes: QTCREATORBUG-30698 Change-Id: I35d56018d8f02a2716dfac763fa86d4426393172 Reviewed-by: Christian Kandeler --- src/plugins/mesonprojectmanager/toolkitaspectwidget.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/plugins/mesonprojectmanager/toolkitaspectwidget.h b/src/plugins/mesonprojectmanager/toolkitaspectwidget.h index 252e351ff71..54e54388a41 100644 --- a/src/plugins/mesonprojectmanager/toolkitaspectwidget.h +++ b/src/plugins/mesonprojectmanager/toolkitaspectwidget.h @@ -49,11 +49,7 @@ private: return MesonToolKitAspect::mesonToolId(m_kit); return NinjaToolKitAspect::ninjaToolId(m_kit); }(); - if (id.isValid()) - m_toolsComboBox->setCurrentIndex(indexOf(id)); - else { - setToDefault(); - } + m_toolsComboBox->setCurrentIndex(indexOf(id)); } QComboBox *m_toolsComboBox;