From e7b1561cc7081dcd7c3311fead494a0ab7b8e176 Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Wed, 2 Nov 2022 15:31:09 +0100 Subject: [PATCH] CorePlugin: Don't leak actions for options Amends d86a67e0bc2624e7a4357860439a13bf1b565951 Change-Id: I45703f4fbc018f1f30375e578aa6c55815db902b Reviewed-by: Eike Ziller --- src/plugins/coreplugin/coreplugin.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/coreplugin/coreplugin.cpp b/src/plugins/coreplugin/coreplugin.cpp index 7f1b170a957..bd5a65cc97b 100644 --- a/src/plugins/coreplugin/coreplugin.cpp +++ b/src/plugins/coreplugin/coreplugin.cpp @@ -258,12 +258,12 @@ static void registerActionsForOptions() categoryDisplay[page->category()] = page->displayCategory(); } for (IOptionsPage *page : IOptionsPage::allOptionsPages()) { - Id commandId = generateOpenPageCommandId(page); + const Id commandId = generateOpenPageCommandId(page); if (!commandId.isValid()) continue; const QString actionTitle = Tr::tr("%1 > %2 Preferences...") .arg(categoryDisplay.value(page->category()), page->displayName()); - auto action = new QAction(actionTitle); + auto action = new QAction(actionTitle, m_instance); QObject::connect(action, &QAction::triggered, m_instance, [id = page->id()]() { ICore::showOptionsDialog(id); });