aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy/empathy-contact.c
diff options
context:
space:
mode:
authorSjoerd Simons <sjoerd.simons@collabora.co.uk>2009-01-10 00:15:37 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2009-01-10 00:15:37 +0800
commit5cc4714ecf91bc2605223594f4726722a99174fd (patch)
tree7bd52cd429ca2662d4f8295433284b30e58d1c28 /libempathy/empathy-contact.c
parent7a745019ad8b2bf41ba32bc12d0ca30245b36d40 (diff)
downloadgsoc2013-empathy-5cc4714ecf91bc2605223594f4726722a99174fd.tar
gsoc2013-empathy-5cc4714ecf91bc2605223594f4726722a99174fd.tar.gz
gsoc2013-empathy-5cc4714ecf91bc2605223594f4726722a99174fd.tar.bz2
gsoc2013-empathy-5cc4714ecf91bc2605223594f4726722a99174fd.tar.lz
gsoc2013-empathy-5cc4714ecf91bc2605223594f4726722a99174fd.tar.xz
gsoc2013-empathy-5cc4714ecf91bc2605223594f4726722a99174fd.tar.zst
gsoc2013-empathy-5cc4714ecf91bc2605223594f4726722a99174fd.zip
Free ready callbacks in finalize
Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk> svn path=/trunk/; revision=2191
Diffstat (limited to 'libempathy/empathy-contact.c')
-rw-r--r--libempathy/empathy-contact.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/libempathy/empathy-contact.c b/libempathy/empathy-contact.c
index a48d69900..6c521650f 100644
--- a/libempathy/empathy-contact.c
+++ b/libempathy/empathy-contact.c
@@ -219,6 +219,7 @@ static void
contact_finalize (GObject *object)
{
EmpathyContactPriv *priv;
+ GList *l;
priv = GET_PRIV (object);
@@ -228,6 +229,18 @@ contact_finalize (GObject *object)
g_free (priv->id);
g_free (priv->presence_message);
+ for (l = priv->ready_callbacks; l != NULL; l = g_list_next (l))
+ {
+ ReadyCbData *d = (ReadyCbData *)l->data;
+
+ if (d->destroy != NULL)
+ d->destroy (d->user_data);
+ g_slice_free (ReadyCbData, d);
+ }
+
+ g_list_free (priv->ready_callbacks);
+ priv->ready_callbacks = NULL;
+
if (priv->avatar)
empathy_avatar_unref (priv->avatar);
@@ -372,8 +385,10 @@ contact_weak_object_notify (gpointer data, GObject *old_object)
if (d->destroy != NULL)
d->destroy (d->user_data);
- priv->ready_callbacks = g_list_delete_link (priv->ready_callbacks,
+ priv->ready_callbacks = g_list_delete_link (priv->ready_callbacks,
l);
+
+ g_slice_free (ReadyCbData, d);
}
}
}
@@ -415,6 +430,7 @@ contact_set_ready_flag (EmpathyContact *contact,
contact_call_ready_callback (contact, NULL, d);
priv->ready_callbacks = g_list_delete_link
(priv->ready_callbacks, l);
+ g_slice_free (ReadyCbData, d);
}
}
}