From d2782ad6bb6dcf4b4dd82e945674323fd8437ad1 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Mon, 24 Apr 2023 22:11:13 +0300 Subject: [PATCH 39/39] Qt: Fix popup_upgrade_dialog() hud_message_box leak See osdn #47930 Signed-off-by: Marko Lindqvist --- client/gui-qt/dialogs.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/gui-qt/dialogs.cpp b/client/gui-qt/dialogs.cpp index d9fdb4abde..9a74218e9d 100644 --- a/client/gui-qt/dialogs.cpp +++ b/client/gui-qt/dialogs.cpp @@ -4379,7 +4379,7 @@ void show_tileset_error(const char *tset_name, const char *msg) void popup_upgrade_dialog(struct unit_list *punits) { char buf[512]; - hud_message_box *ask = new hud_message_box(gui()->central_wdg); + hud_message_box *ask; QString title; QVector *punit_ids; @@ -4387,6 +4387,8 @@ void popup_upgrade_dialog(struct unit_list *punits) return; } + ask = new hud_message_box(gui()->central_wdg); + punit_ids = new QVector(); unit_list_iterate(punits, punit) { punit_ids->push_back(punit->id); -- 2.39.2