]> git.0d.be Git - empathy.git/commitdiff
unref avatar and location in dispose rather than finalize
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Thu, 8 Apr 2010 11:31:09 +0000 (13:31 +0200)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Thu, 8 Apr 2010 13:51:50 +0000 (15:51 +0200)
libempathy/empathy-contact.c

index ea5f91d1ddf5c7addb47810c2fb7ff17bd7e5a23..707031afbd756900183e3d0e69a7241a9ccccae6 100644 (file)
@@ -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);
 }