aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre-Luc Beaudoin <pierre-luc.beaudoin@collabora.co.uk>2009-05-29 05:03:35 +0800
committerPierre-Luc Beaudoin <pierre-luc.beaudoin@collabora.co.uk>2009-06-01 23:35:32 +0800
commit2556a450e8c1c1deb5330dacb00087e6c56d8f57 (patch)
treeb8dd4c211d1d383e13ae032f589d7a837877b31e
parent06785f7e2f1cb5634ca941d9933fd3877d63d214 (diff)
downloadgsoc2013-empathy-2556a450e8c1c1deb5330dacb00087e6c56d8f57.tar
gsoc2013-empathy-2556a450e8c1c1deb5330dacb00087e6c56d8f57.tar.gz
gsoc2013-empathy-2556a450e8c1c1deb5330dacb00087e6c56d8f57.tar.bz2
gsoc2013-empathy-2556a450e8c1c1deb5330dacb00087e6c56d8f57.tar.lz
gsoc2013-empathy-2556a450e8c1c1deb5330dacb00087e6c56d8f57.tar.xz
gsoc2013-empathy-2556a450e8c1c1deb5330dacb00087e6c56d8f57.tar.zst
gsoc2013-empathy-2556a450e8c1c1deb5330dacb00087e6c56d8f57.zip
Rename empathy_location_manager_get_default to dup_default
This is more consistent with the rest of Empathy.
-rw-r--r--libempathy-gtk/empathy-location-manager.c10
-rw-r--r--libempathy-gtk/empathy-location-manager.h2
-rw-r--r--src/empathy.c2
3 files changed, 9 insertions, 5 deletions
diff --git a/libempathy-gtk/empathy-location-manager.c b/libempathy-gtk/empathy-location-manager.c
index 90478ff36..27eca756a 100644
--- a/libempathy-gtk/empathy-location-manager.c
+++ b/libempathy-gtk/empathy-location-manager.c
@@ -275,12 +275,16 @@ location_manager_set_property (GObject *object,
EmpathyLocationManager *
-empathy_location_manager_get_default (void)
+empathy_location_manager_dup_default (void)
{
static EmpathyLocationManager *singleton = NULL;
if (singleton == NULL)
- singleton = g_object_new (EMPATHY_TYPE_LOCATION_MANAGER, NULL);
- return singleton;
+ {
+ singleton = g_object_new (EMPATHY_TYPE_LOCATION_MANAGER, NULL);
+ g_object_add_weak_pointer (G_OBJECT (singleton), (gpointer *)&singleton);
+ }
+
+ return g_object_ref (singleton);
}
static void
diff --git a/libempathy-gtk/empathy-location-manager.h b/libempathy-gtk/empathy-location-manager.h
index 9315c4646..fbe2b0667 100644
--- a/libempathy-gtk/empathy-location-manager.h
+++ b/libempathy-gtk/empathy-location-manager.h
@@ -50,7 +50,7 @@ struct _EmpathyLocationManagerClass
};
GType empathy_location_manager_get_type (void) G_GNUC_CONST;
-EmpathyLocationManager * empathy_location_manager_get_default (void);
+EmpathyLocationManager * empathy_location_manager_dup_default (void);
G_END_DECLS
diff --git a/src/empathy.c b/src/empathy.c
index 60c250838..617543a55 100644
--- a/src/empathy.c
+++ b/src/empathy.c
@@ -588,7 +588,7 @@ main (int argc, char *argv[])
/* Location mananger */
#if HAVE_GEOCLUE
- location_manager = empathy_location_manager_get_default ();
+ location_manager = empathy_location_manager_dup_default ();
#endif
gtk_main ();