aboutsummaryrefslogtreecommitdiff
path: root/src/ui/chat.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/chat.c')
-rw-r--r--src/ui/chat.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/ui/chat.c b/src/ui/chat.c
index a8547ba..42ccb9e 100644
--- a/src/ui/chat.c
+++ b/src/ui/chat.c
@@ -26,6 +26,7 @@
26 26
27#include <gdk/gdkkeysyms.h> 27#include <gdk/gdkkeysyms.h>
28 28
29#include "message.h"
29#include "messenger.h" 30#include "messenger.h"
30#include "picker.h" 31#include "picker.h"
31#include "profile_entry.h" 32#include "profile_entry.h"
@@ -252,6 +253,8 @@ ui_chat_new(MESSENGER_Application *app)
252 UI_CHAT_Handle *handle = g_malloc(sizeof(UI_CHAT_Handle)); 253 UI_CHAT_Handle *handle = g_malloc(sizeof(UI_CHAT_Handle));
253 UI_MESSENGER_Handle *messenger = &(app->ui.messenger); 254 UI_MESSENGER_Handle *messenger = &(app->ui.messenger);
254 255
256 handle->messages = NULL;
257
255 handle->builder = gtk_builder_new_from_file( 258 handle->builder = gtk_builder_new_from_file(
256 "resources/ui/chat.ui" 259 "resources/ui/chat.ui"
257 ); 260 );
@@ -552,5 +555,17 @@ ui_chat_delete(UI_CHAT_Handle *handle)
552 555
553 g_object_unref(handle->builder); 556 g_object_unref(handle->builder);
554 557
558 GList *list = handle->messages;
559
560 while (list) {
561 if (list->data)
562 ui_message_delete((UI_MESSAGE_Handle*) list->data);
563
564 list = list->next;
565 }
566
567 if (handle->messages)
568 g_list_free(handle->messages);
569
555 g_free(handle); 570 g_free(handle);
556} 571}