]> git.0d.be Git - empathy.git/commitdiff
account-widget: ensure that the object stays alive during the tp_account_manager_prep...
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Tue, 22 Dec 2009 15:37:15 +0000 (15:37 +0000)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Fri, 25 Dec 2009 18:06:47 +0000 (18:06 +0000)
libempathy-gtk/empathy-account-widget.c

index 216a36571a13370276d22ebbd1dc716587b89dd2..4747c8c9e52911285b8b627e5d20c31ac8ffabd0 100644 (file)
@@ -1343,7 +1343,7 @@ account_manager_ready_cb (GObject *source_object,
     {
       DEBUG ("Failed to prepare account manager: %s", error->message);
       g_error_free (error);
-      return;
+      goto out;
     }
 
   state = tp_account_manager_get_most_available_presence (account_manager, NULL,
@@ -1352,6 +1352,9 @@ account_manager_ready_cb (GObject *source_object,
   /* simulate a presence change so the apply button will be changed
    * if needed */
   presence_changed_cb (account_manager, state, NULL, NULL, self);
+
+out:
+  g_object_unref (self);
 }
 
 #define WIDGET(cm, proto) \
@@ -1556,6 +1559,7 @@ do_constructed (GObject *obj)
   /* dup and init the account-manager */
   priv->account_manager = tp_account_manager_dup ();
 
+  g_object_ref (self);
   tp_account_manager_prepare_async (priv->account_manager, NULL,
       account_manager_ready_cb, self);