about summary refs log tree commit diff stats
path: root/src/ui
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/console.c19
-rw-r--r--src/ui/titlebar.c5
-rw-r--r--src/ui/window.c2
3 files changed, 17 insertions, 9 deletions
diff --git a/src/ui/console.c b/src/ui/console.c
index 579d9c49..14ee7314 100644
--- a/src/ui/console.c
+++ b/src/ui/console.c
@@ -717,20 +717,24 @@ cons_show_account(ProfAccount *account)
         GList *resources = jabber_get_available_resources();
         GList *ordered_resources = NULL;
 
-        if (resources != NULL) {
+        GList *curr = resources;
+        if (curr != NULL) {
             win_save_println(console, "Resources:");
 
             // sort in order of availabiltiy
-            while (resources != NULL) {
-                Resource *resource = resources->data;
+            while (curr != NULL) {
+                Resource *resource = curr->data;
                 ordered_resources = g_list_insert_sorted(ordered_resources,
                     resource, (GCompareFunc)resource_compare_availability);
-                resources = g_list_next(resources);
+                curr = g_list_next(curr);
             }
         }
 
-        while (ordered_resources != NULL) {
-            Resource *resource = ordered_resources->data;
+        g_list_free(resources);
+
+        curr = ordered_resources;
+        while (curr != NULL) {
+            Resource *resource = curr->data;
             const char *resource_presence = string_from_resource_presence(resource->presence);
             theme_item_t presence_colour = theme_main_presence_attrs(resource_presence);
             win_save_vprint(console, '-', NULL, NO_EOL, presence_colour, "", "  %s (%d), %s", resource->name, resource->priority, resource_presence);
@@ -785,8 +789,9 @@ cons_show_account(ProfAccount *account)
                 caps_destroy(caps);
             }
 
-            ordered_resources = g_list_next(ordered_resources);
+            curr = g_list_next(curr);
         }
+        g_list_free(ordered_resources);
     }
 
     cons_alert();
diff --git a/src/ui/titlebar.c b/src/ui/titlebar.c
index 326dbf8b..a3299946 100644
--- a/src/ui/titlebar.c
+++ b/src/ui/titlebar.c
@@ -109,8 +109,11 @@ void
 title_bar_console(void)
 {
     werase(win);
-    typing = FALSE;
+    if (typing_elapsed) {
+        g_timer_destroy(typing_elapsed);
+    }
     typing_elapsed = NULL;
+    typing = FALSE;
 
     _title_bar_draw();
 }
diff --git a/src/ui/window.c b/src/ui/window.c
index e235dda5..bfef7946 100644
--- a/src/ui/window.c
+++ b/src/ui/window.c
@@ -337,7 +337,7 @@ win_free(ProfWin* window)
         ProfChatWin *chatwin = (ProfChatWin*)window;
         free(chatwin->barejid);
         free(chatwin->resource_override);
-        free(chatwin->state);
+        chat_state_free(chatwin->state);
     }
 
     if (window->type == WIN_MUC) {