Project

General

Profile

Bug #2306 » 0077-gtk4-x-Fix-diplodlg-double-destruction.patch

main - Marko Lindqvist, 09/29/2026 09:17 PM

View differences:

client/gui-gtk-4.0/diplodlg.c
}
/************************************************************************//**
Destroy diplomacy dialog
Remove diplomacy dialog from use.
****************************************************************************/
static void diplomacy_destroy(struct Diplomacy_dialog *pdialog)
static void diplomacy_remove(struct Diplomacy_dialog *pdialog)
{
if (NULL != pdialog->dialog) {
/* pdialog->dialog may be NULL if the tab has been destroyed
* by an other way. */
gui_dialog_destroy(pdialog->dialog);
pdialog->dialog = NULL;
}
/* Dialog destroy callbacks will take care of freeing everything
* related to the pdialog->dialog.
* Here we just take the dialog out of use. */
dialog_list_remove(dialog_list, pdialog);
if (dialog_list) {
......
****************************************************************************/
void close_diplomacy_dialog(struct Diplomacy_dialog *pdialog)
{
diplomacy_destroy(pdialog);
diplomacy_remove(pdialog);
}
/************************************************************************//**
client/gui-gtk-5.0/diplodlg.c
}
/************************************************************************//**
Destroy diplomacy dialog
Remove diplomacy dialog from use.
****************************************************************************/
static void diplomacy_destroy(struct Diplomacy_dialog *pdialog)
static void diplomacy_remove(struct Diplomacy_dialog *pdialog)
{
if (NULL != pdialog->dialog) {
/* pdialog->dialog may be NULL if the tab has been destroyed
* by an other way. */
gui_dialog_destroy(pdialog->dialog);
pdialog->dialog = NULL;
}
/* Dialog destroy callbacks will take care of freeing everything
* related to the pdialog->dialog.
* Here we just take the dialog out of use. */
dialog_list_remove(dialog_list, pdialog);
if (dialog_list) {
......
****************************************************************************/
void close_diplomacy_dialog(struct Diplomacy_dialog *pdialog)
{
diplomacy_destroy(pdialog);
diplomacy_remove(pdialog);
}
/************************************************************************//**
(1-1/2)