From 108817b949df863a7c17748587dbccc9b313ba16 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Tue, 19 Apr 2011 17:12:20 +0200 Subject: location_manager_dispose: use tp_clear_* --- libempathy-gtk/empathy-location-manager.c | 41 +++++-------------------------- 1 file changed, 6 insertions(+), 35 deletions(-) diff --git a/libempathy-gtk/empathy-location-manager.c b/libempathy-gtk/empathy-location-manager.c index 1925d4371..d34cf10c6 100644 --- a/libempathy-gtk/empathy-location-manager.c +++ b/libempathy-gtk/empathy-location-manager.c @@ -103,41 +103,12 @@ location_manager_dispose (GObject *object) void (*dispose) (GObject *) = G_OBJECT_CLASS (empathy_location_manager_parent_class)->dispose; - if (priv->account_manager != NULL) - { - g_object_unref (priv->account_manager); - priv->account_manager = NULL; - } - - if (priv->gsettings_loc != NULL) - { - g_object_unref (priv->gsettings_loc); - priv->gsettings_loc = NULL; - } - - if (priv->gc_client != NULL) - { - g_object_unref (priv->gc_client); - priv->gc_client = NULL; - } - - if (priv->gc_position != NULL) - { - g_object_unref (priv->gc_position); - priv->gc_position = NULL; - } - - if (priv->gc_address != NULL) - { - g_object_unref (priv->gc_address); - priv->gc_address = NULL; - } - - if (priv->location != NULL) - { - g_hash_table_unref (priv->location); - priv->location = NULL; - } + tp_clear_object (&priv->account_manager); + tp_clear_object (&priv->gsettings_loc); + tp_clear_object (&priv->gc_client); + tp_clear_object (&priv->gc_position); + tp_clear_object (&priv->gc_address); + tp_clear_pointer (&priv->location, g_hash_table_unref); if (dispose != NULL) dispose (object); -- cgit v1.2.3