[empathy] unref avatar and location in dispose rather than finalize
- From: Guillaume Desmottes <gdesmott src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [empathy] unref avatar and location in dispose rather than finalize
- Date: Thu, 8 Apr 2010 13:52:05 +0000 (UTC)
commit 04ef027198384baacd47346f59c8a22c5c7d2e20
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date: Thu Apr 8 13:31:09 2010 +0200
unref avatar and location in dispose rather than finalize
libempathy/empathy-contact.c | 18 ++++++++++++------
1 files changed, 12 insertions(+), 6 deletions(-)
---
diff --git a/libempathy/empathy-contact.c b/libempathy/empathy-contact.c
index ea5f91d..707031a 100644
--- a/libempathy/empathy-contact.c
+++ b/libempathy/empathy-contact.c
@@ -157,6 +157,18 @@ contact_dispose (GObject *object)
g_object_unref (priv->account);
priv->account = NULL;
+ if (priv->avatar != NULL)
+ {
+ empathy_avatar_unref (priv->avatar);
+ priv->avatar = NULL;
+ }
+
+ if (priv->location != NULL)
+ {
+ g_hash_table_unref (priv->location);
+ priv->location = NULL;
+ }
+
G_OBJECT_CLASS (empathy_contact_parent_class)->dispose (object);
}
@@ -304,12 +316,6 @@ contact_finalize (GObject *object)
g_free (priv->id);
g_free (priv->presence_message);
- if (priv->avatar)
- empathy_avatar_unref (priv->avatar);
-
- if (priv->location != NULL)
- g_hash_table_unref (priv->location);
-
G_OBJECT_CLASS (empathy_contact_parent_class)->finalize (object);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]