diff options
Diffstat (limited to 'src/ui/messenger.c')
-rw-r--r-- | src/ui/messenger.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/src/ui/messenger.c b/src/ui/messenger.c index 1d09608..afa444b 100644 --- a/src/ui/messenger.c +++ b/src/ui/messenger.c | |||
@@ -192,7 +192,7 @@ void | |||
192 | ui_messenger_init(MESSENGER_Application *app, | 192 | ui_messenger_init(MESSENGER_Application *app, |
193 | UI_MESSENGER_Handle *handle) | 193 | UI_MESSENGER_Handle *handle) |
194 | { | 194 | { |
195 | handle->chat_entries = g_list_alloc(); | 195 | handle->chat_entries = NULL; |
196 | 196 | ||
197 | handle->builder = gtk_builder_new_from_file("resources/ui/messenger.ui"); | 197 | handle->builder = gtk_builder_new_from_file("resources/ui/messenger.ui"); |
198 | 198 | ||
@@ -401,14 +401,9 @@ ui_messenger_cleanup(UI_MESSENGER_Handle *handle) | |||
401 | { | 401 | { |
402 | g_object_unref(handle->builder); | 402 | g_object_unref(handle->builder); |
403 | 403 | ||
404 | GList *list = handle->chat_entries; | 404 | for (GList *list = handle->chat_entries; list; list = list->next) |
405 | ui_chat_entry_delete((UI_CHAT_ENTRY_Handle*) list->data); | ||
405 | 406 | ||
406 | while (list) { | 407 | if (handle->chat_entries) |
407 | if (list->data) | 408 | g_list_free(handle->chat_entries); |
408 | ui_chat_entry_delete((UI_CHAT_ENTRY_Handle*) list->data); | ||
409 | |||
410 | list = list->next; | ||
411 | } | ||
412 | |||
413 | g_list_free(handle->chat_entries); | ||
414 | } | 409 | } |