[telepathy-haze/master] Delete PurpleAccount in connection's finalizer.

Will Thompson will.thompson at collabora.co.uk
Fri Mar 27 17:32:34 PDT 2009


Given that it's created in (something resembling) HazeConnection's
constructor, it should be destroyed only during destruction.
---
 src/connection.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/connection.c b/src/connection.c
index 069cf8e..7db520e 100644
--- a/src/connection.c
+++ b/src/connection.c
@@ -206,8 +206,6 @@ idle_disconnected_cb(gpointer data)
     PurpleAccount *account = (PurpleAccount *) data;
     HazeConnection *conn = ACCOUNT_GET_HAZE_CONNECTION (account);
 
-    DEBUG ("deleting account %s", account->username);
-    purple_accounts_delete (account);
     tp_base_connection_finish_shutdown (TP_BASE_CONNECTION (conn));
     return FALSE;
 }
@@ -549,6 +547,12 @@ haze_connection_finalize (GObject *object)
 
     g_strfreev (self->acceptable_avatar_mime_types);
 
+    if (self->account != NULL)
+      {
+        DEBUG ("deleting account %s", self->account->username);
+        purple_accounts_delete (self->account);
+      }
+
     G_OBJECT_CLASS (haze_connection_parent_class)->finalize (object);
 }
 
-- 
1.5.6.5




More information about the telepathy-commits mailing list