commit 14925c42396be6ab1db75a423675a6182c367974
parent 078942ede53ba5c4180d673283e3495e4b4cc879
Author: Jacki <jacki@thejackimonster.de>
Date: Sun, 5 May 2024 22:56:50 +0200
Fix leaking account entries
Signed-off-by: Jacki <jacki@thejackimonster.de>
Diffstat:
2 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/src/ui/accounts.c b/src/ui/accounts.c
@@ -113,6 +113,8 @@ handle_dialog_destroy(UNUSED GtkWidget *window,
MESSENGER_Application *app = (MESSENGER_Application*) user_data;
+ ui_accounts_dialog_cleanup(&(app->ui.accounts), app);
+
if ((app->ui.accounts.show_queued) ||
(gtk_widget_is_visible(GTK_WIDGET(app->ui.messenger.main_window))))
return;
@@ -224,13 +226,13 @@ _ui_accounts_cleanup_listbox(UI_ACCOUNTS_Handle *handle,
app->quarks.ui
);
- ui_account_entry_delete(entry);
-
gtk_container_remove(
GTK_CONTAINER(handle->accounts_listbox),
GTK_WIDGET(row)
);
+ ui_account_entry_delete(entry);
+
skip_row:
item = item->next;
}
@@ -263,12 +265,9 @@ ui_accounts_dialog_cleanup(UI_ACCOUNTS_Handle *handle,
{
g_assert((handle) && (app));
- if (handle->builder)
- {
- _ui_accounts_cleanup_listbox(handle, app);
+ _ui_accounts_cleanup_listbox(handle, app);
- g_object_unref(handle->builder);
- }
+ g_object_unref(handle->builder);
guint show = handle->show_queued;
memset(handle, 0, sizeof(*handle));
diff --git a/src/ui/messenger.c b/src/ui/messenger.c
@@ -388,8 +388,7 @@ handle_main_window_destroy(UNUSED GtkWidget *window,
#endif
ui_messenger_cleanup(&(app->ui.messenger));
- ui_accounts_dialog_cleanup(&(app->ui.accounts), app);
-
+
account_cleanup_infos();
application_exit(app, MESSENGER_QUIT);