commit f887357406c51121f7530716f8ddf73f62d8c135
parent f9f3a966c955e4db397c955e01b78be512fa0997
Author: Jacki <jacki@thejackimonster.de>
Date: Mon, 22 Apr 2024 19:11:01 +0200
Fix UI cleanup routine switching profiles
Signed-off-by: Jacki <jacki@thejackimonster.de>
Diffstat:
2 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/src/event.c b/src/event.c
@@ -356,13 +356,6 @@ event_update_profile(MESSENGER_Application *app)
ui_label_set_text(ui->profile_key_label, key);
- GList *entries = gtk_container_get_children(
- GTK_CONTAINER(ui->chats_listbox)
- );
-
- g_list_foreach(entries, (GFunc) _clear_chat_entry, app);
- g_list_free(entries);
-
gtk_stack_set_visible_child(ui->chats_stack, ui->no_chat_box);
GNUNET_CHAT_iterate_contacts(chat->handle, _iterate_profile_contacts, app);
@@ -384,8 +377,16 @@ event_cleanup_profile(MESSENGER_Application *app)
{
g_assert(app);
+ UI_MESSENGER_Handle *ui = &(app->ui.messenger);
CHAT_MESSENGER_Handle *chat = &(app->chat.messenger);
+ GList *entries = gtk_container_get_children(
+ GTK_CONTAINER(ui->chats_listbox)
+ );
+
+ g_list_foreach(entries, (GFunc) _clear_chat_entry, app);
+ g_list_free(entries);
+
GNUNET_CHAT_iterate_contacts(chat->handle, _cleanup_profile_contacts, NULL);
}
diff --git a/src/ui/chat.c b/src/ui/chat.c
@@ -2251,8 +2251,6 @@ ui_chat_delete(UI_CHAT_Handle *handle)
ui_picker_delete(handle->picker);
- g_object_unref(handle->builder);
-
if (handle->loads)
g_list_free_full(handle->loads, (GDestroyNotify) ui_file_load_entry_delete);
@@ -2260,6 +2258,8 @@ ui_chat_delete(UI_CHAT_Handle *handle)
_chat_update_files(handle, handle->app, NULL);
_chat_update_media(handle, handle->app, NULL);
+ g_object_unref(handle->builder);
+
if (handle->record_pipeline)
{
gst_element_set_state(handle->record_pipeline, GST_STATE_NULL);