From 454e9635d737114e6c45177e759312f05450e252 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sun, 3 Jul 2022 07:54:35 +0300 Subject: [PATCH 53/53] Qt: Fix go_act_menu memory leak See osdn #44983 Signed-off-by: Marko Lindqvist --- client/gui-qt/menu.cpp | 4 ++-- client/gui-qt/menu.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/client/gui-qt/menu.cpp b/client/gui-qt/menu.cpp index fae6c45ca0..5bb951cc5e 100644 --- a/client/gui-qt/menu.cpp +++ b/client/gui-qt/menu.cpp @@ -692,7 +692,7 @@ void gov_menu::update_all() /**********************************************************************//** Instantiate a new goto and act sub menu. **************************************************************************/ -go_act_menu::go_act_menu(QWidget* parent) +go_act_menu::go_act_menu(QWidget *parent) : QMenu(_("Go to and..."), parent) { // Will need auto updates etc. @@ -1207,7 +1207,7 @@ void mr_menu::setup_menus() connect(act, &QAction::triggered, this, &mr_menu::slot_unit_goto); // The goto and act sub menu is handled as a separate object. - main_menu->addMenu(new go_act_menu()); + main_menu->addMenu(new go_act_menu(this)); act = main_menu->addAction(_("Go to Nearest City")); act->setShortcut(QKeySequence(tr("shift+g"))); diff --git a/client/gui-qt/menu.h b/client/gui-qt/menu.h index f70526d4eb..1f454f4498 100644 --- a/client/gui-qt/menu.h +++ b/client/gui-qt/menu.h @@ -237,7 +237,7 @@ class go_act_menu : public QMenu QMap items; public: - go_act_menu(QWidget* parent = 0); + go_act_menu(QWidget *parent = nullptr); virtual ~go_act_menu(); static void reset_all(); -- 2.35.1