diff options
author | Cosimo Cecchi <cosimo.cecchi@collabora.co.uk> | 2009-10-15 22:56:07 +0800 |
---|---|---|
committer | Cosimo Cecchi <cosimo.cecchi@collabora.co.uk> | 2009-10-15 23:39:55 +0800 |
commit | ad55f6268d5b940ff1e3a7bd966c757cd8879c4c (patch) | |
tree | 43fd6d9b6f4aa3eb8d6b7590a271c4791f9d5524 /src/empathy-debug-window.c | |
parent | 109e8841508f423be4e096bc02bef211282938ba (diff) | |
download | gsoc2013-empathy-ad55f6268d5b940ff1e3a7bd966c757cd8879c4c.tar gsoc2013-empathy-ad55f6268d5b940ff1e3a7bd966c757cd8879c4c.tar.gz gsoc2013-empathy-ad55f6268d5b940ff1e3a7bd966c757cd8879c4c.tar.bz2 gsoc2013-empathy-ad55f6268d5b940ff1e3a7bd966c757cd8879c4c.tar.lz gsoc2013-empathy-ad55f6268d5b940ff1e3a7bd966c757cd8879c4c.tar.xz gsoc2013-empathy-ad55f6268d5b940ff1e3a7bd966c757cd8879c4c.tar.zst gsoc2013-empathy-ad55f6268d5b940ff1e3a7bd966c757cd8879c4c.zip |
Factor out free-ing the message list.
Diffstat (limited to 'src/empathy-debug-window.c')
-rw-r--r-- | src/empathy-debug-window.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/empathy-debug-window.c b/src/empathy-debug-window.c index bdf215efb..39280d820 100644 --- a/src/empathy-debug-window.c +++ b/src/empathy-debug-window.c @@ -170,6 +170,15 @@ debug_message_free (DebugMessage *dm) } static void +debug_message_list_free (gpointer data) +{ + GList *list = data; + + g_list_foreach (list, (GFunc) debug_message_free, NULL); + g_list_free (list); +} + +static void debug_window_cache_new_message (EmpathyDebugWindow *debug_window, gdouble timestamp, const gchar *domain, @@ -343,8 +352,7 @@ debug_window_get_messages_cb (TpProxy *proxy, if (old_messages != NULL) { g_hash_table_remove (priv->all_cms, name); - g_list_foreach (old_messages, (GFunc) debug_message_free, NULL); - g_list_free (old_messages); + debug_message_list_free (old_messages); } for (i = 0; i < messages->len; i++) @@ -1345,8 +1353,7 @@ debug_window_finalize (GObject *object) while (g_hash_table_iter_next (&iter, (gpointer *) &key, (gpointer *) &values)) { - g_list_foreach (values, (GFunc) debug_message_free, NULL); - g_list_free (values); + debug_message_list_free (values); } g_hash_table_destroy (priv->all_cms); |