diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2011-11-14 19:19:54 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2011-11-14 22:37:22 +0800 |
commit | d75899267ec482020f564117f34ca1e8f2965711 (patch) | |
tree | bfb56b988df46039f74cb54f989a156168dcfd61 | |
parent | 45da1ad2170f19eecb8abe6e55ae1be851ddfb18 (diff) | |
download | gsoc2013-empathy-d75899267ec482020f564117f34ca1e8f2965711.tar gsoc2013-empathy-d75899267ec482020f564117f34ca1e8f2965711.tar.gz gsoc2013-empathy-d75899267ec482020f564117f34ca1e8f2965711.tar.bz2 gsoc2013-empathy-d75899267ec482020f564117f34ca1e8f2965711.tar.lz gsoc2013-empathy-d75899267ec482020f564117f34ca1e8f2965711.tar.xz gsoc2013-empathy-d75899267ec482020f564117f34ca1e8f2965711.tar.zst gsoc2013-empathy-d75899267ec482020f564117f34ca1e8f2965711.zip |
fix GDate leaks when getting dates from the model
https://bugzilla.gnome.org/show_bug.cgi?id=663873
-rw-r--r-- | libempathy-gtk/empathy-log-window.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/libempathy-gtk/empathy-log-window.c b/libempathy-gtk/empathy-log-window.c index 4addfda23..c6f526daa 100644 --- a/libempathy-gtk/empathy-log-window.c +++ b/libempathy-gtk/empathy-log-window.c @@ -1620,9 +1620,11 @@ model_has_date (GtkTreeModel *model, if (!g_date_compare (date, d)) { has_element = TRUE; + g_date_free (d); return TRUE; } + g_date_free (d); return FALSE; } @@ -2791,6 +2793,7 @@ sort_by_date (GtkTreeModel *model, gpointer user_data) { GDate *date1, *date2; + gint result; gtk_tree_model_get (model, a, COL_WHEN_DATE, &date1, @@ -2800,7 +2803,11 @@ sort_by_date (GtkTreeModel *model, COL_WHEN_DATE, &date2, -1); - return g_date_compare (date1, date2); + result = g_date_compare (date1, date2); + + g_date_free (date1); + g_date_free (date2); + return result; } static gboolean @@ -3343,6 +3350,8 @@ log_window_get_messages_for_dates (EmpathyLogWindow *self, event_mask, subtype, self->priv->count); _tpl_action_chain_append (self->priv->chain, get_events_for_date, ctx); } + + g_date_free (d); } } } |