aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-location-manager.c
diff options
context:
space:
mode:
authorPierre-Luc Beaudoin <pierre-luc.beaudoin@collabora.co.uk>2009-05-30 03:35:14 +0800
committerPierre-Luc Beaudoin <pierre-luc.beaudoin@collabora.co.uk>2009-06-01 23:35:32 +0800
commita1d1a2307eb7168be75e46ee89dc016354a62f2c (patch)
tree1b749fc5d4726e51e97f3b51324a7172b3f32c19 /libempathy-gtk/empathy-location-manager.c
parent1de150bc48080744009389fb09eb45d4ff96abd2 (diff)
downloadgsoc2013-empathy-a1d1a2307eb7168be75e46ee89dc016354a62f2c.tar
gsoc2013-empathy-a1d1a2307eb7168be75e46ee89dc016354a62f2c.tar.gz
gsoc2013-empathy-a1d1a2307eb7168be75e46ee89dc016354a62f2c.tar.bz2
gsoc2013-empathy-a1d1a2307eb7168be75e46ee89dc016354a62f2c.tar.lz
gsoc2013-empathy-a1d1a2307eb7168be75e46ee89dc016354a62f2c.tar.xz
gsoc2013-empathy-a1d1a2307eb7168be75e46ee89dc016354a62f2c.tar.zst
gsoc2013-empathy-a1d1a2307eb7168be75e46ee89dc016354a62f2c.zip
Properly unref objects used by EmpathyLocationManager
Diffstat (limited to 'libempathy-gtk/empathy-location-manager.c')
-rw-r--r--libempathy-gtk/empathy-location-manager.c38
1 files changed, 32 insertions, 6 deletions
diff --git a/libempathy-gtk/empathy-location-manager.c b/libempathy-gtk/empathy-location-manager.c
index 67c49d775..f26a8d26a 100644
--- a/libempathy-gtk/empathy-location-manager.c
+++ b/libempathy-gtk/empathy-location-manager.c
@@ -68,7 +68,7 @@ typedef struct {
guint idle_id;
} EmpathyLocationManagerPriv;
-static void location_manager_finalize (GObject *object);
+static void location_manager_dispose (GObject *object);
static void location_manager_get_property (GObject *object, guint param_id,
GValue *value, GParamSpec *pspec);
static void location_manager_set_property (GObject *object, guint param_id,
@@ -104,7 +104,7 @@ empathy_location_manager_class_init (EmpathyLocationManagerClass *class)
object_class = G_OBJECT_CLASS (class);
- object_class->finalize = location_manager_finalize;
+ object_class->dispose = location_manager_dispose;
object_class->get_property = location_manager_get_property;
object_class->set_property = location_manager_set_property;
@@ -237,14 +237,40 @@ empathy_location_manager_init (EmpathyLocationManager *location_manager)
static void
-location_manager_finalize (GObject *object)
+location_manager_dispose (GObject *object)
{
EmpathyLocationManagerPriv *priv;
-
priv = GET_PRIV (object);
- DEBUG ("finalize: %p", object);
- g_object_unref (priv->account_manager);
+ if (priv->account_manager != NULL)
+ {
+ g_object_unref (priv->account_manager);
+ priv->account_manager = 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;
+ }
G_OBJECT_CLASS (empathy_location_manager_parent_class)->finalize (object);
}