QmlProjectPlugin: Don't leak action on shutdown

Detected by memory analyzer.

Change-Id: I5c1ba80e9a1e1ca620b496ebe6cd9bb600e8b800
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Jarek Kobus
2022-06-27 14:24:35 +02:00
parent 175a61ad1b
commit a0de1f1848
8 changed files with 13 additions and 13 deletions

View File

@@ -81,11 +81,11 @@ enum ProjectDirectoryError {
const QString MENU_ITEM_GENERATE = QCoreApplication::translate("QmlDesigner::GenerateCmake",
"Generate CMake Build Files");
void generateMenuEntry()
void generateMenuEntry(QObject *parent)
{
Core::ActionContainer *menu =
Core::ActionManager::actionContainer(Core::Constants::M_FILE);
auto action = new QAction(MENU_ITEM_GENERATE);
auto action = new QAction(MENU_ITEM_GENERATE, parent);
QObject::connect(action, &QAction::triggered, GenerateCmake::onGenerateCmakeLists);
Core::Command *cmd = Core::ActionManager::registerAction(action, "QmlProject.CreateCMakeLists");
menu->addAction(cmd, Core::Constants::G_FILE_EXPORT);