]> git.0d.be Git - empathy.git/commitdiff
account-widget: modernize dipose function
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Wed, 21 Dec 2011 10:27:56 +0000 (11:27 +0100)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Thu, 22 Dec 2011 09:46:19 +0000 (10:46 +0100)
libempathy-gtk/empathy-account-widget.c

index a36cbb18855d7618937ef88b6d2e07b375bc14ce..9ca98bc3f7db37d546b19336b208b9490d9e795e 100644 (file)
@@ -115,8 +115,6 @@ struct _EmpathyAccountWidgetPriv {
   /* Used for 'special' XMPP account having a service associated ensuring that
    * JIDs have a specific suffix; such as Facebook for example */
   gchar *jid_suffix;
-
-  gboolean dispose_run;
 };
 
 enum {
@@ -2057,22 +2055,8 @@ do_dispose (GObject *obj)
 {
   EmpathyAccountWidget *self = EMPATHY_ACCOUNT_WIDGET (obj);
 
-  if (self->priv->dispose_run)
-    return;
-
-  self->priv->dispose_run = TRUE;
-
-  if (self->priv->settings != NULL)
-    {
-      g_object_unref (self->priv->settings);
-      self->priv->settings = NULL;
-    }
-
-  if (self->priv->account_manager != NULL)
-    {
-      g_object_unref (self->priv->account_manager);
-      self->priv->account_manager = NULL;
-    }
+  g_clear_object (&self->priv->settings);
+  g_clear_object (&self->priv->account_manager);
 
   if (G_OBJECT_CLASS (empathy_account_widget_parent_class)->dispose != NULL)
     G_OBJECT_CLASS (empathy_account_widget_parent_class)->dispose (obj);
@@ -2175,8 +2159,6 @@ empathy_account_widget_init (EmpathyAccountWidget *self)
   self->priv = G_TYPE_INSTANCE_GET_PRIVATE ((self), EMPATHY_TYPE_ACCOUNT_WIDGET,
         EmpathyAccountWidgetPriv);
 
-  self->priv->dispose_run = FALSE;
-
   self->ui_details = g_slice_new0 (EmpathyAccountWidgetUIDetails);
 }