[empathy] fix GDate leaks when getting dates from the model
- From: Guillaume Desmottes <gdesmott src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [empathy] fix GDate leaks when getting dates from the model
- Date: Mon, 14 Nov 2011 14:39:06 +0000 (UTC)
commit d75899267ec482020f564117f34ca1e8f2965711
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date: Mon Nov 14 12:19:54 2011 +0100
fix GDate leaks when getting dates from the model
https://bugzilla.gnome.org/show_bug.cgi?id=663873
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 4addfda..c6f526d 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);
}
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]