[empathy/gnome-3-2] fix GDate leaks when getting dates from the model
- From: Guillaume Desmottes <gdesmott src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [empathy/gnome-3-2] fix GDate leaks when getting dates from the model
- Date: Mon, 14 Nov 2011 14:38:45 +0000 (UTC)
commit b116f867f9247465fd59ace6ba73991f281b38dd
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 aa1acc9..5ca1d41 100644
--- a/libempathy-gtk/empathy-log-window.c
+++ b/libempathy-gtk/empathy-log-window.c
@@ -1634,9 +1634,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;
}
@@ -2805,6 +2807,7 @@ sort_by_date (GtkTreeModel *model,
gpointer user_data)
{
GDate *date1, *date2;
+ gint result;
gtk_tree_model_get (model, a,
COL_WHEN_DATE, &date1,
@@ -2814,7 +2817,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
@@ -3357,6 +3364,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]