diff options
Diffstat (limited to 'libempathy-gtk')
-rw-r--r-- | libempathy-gtk/empathy-location-manager.c | 10 | ||||
-rw-r--r-- | libempathy-gtk/empathy-location-manager.h | 2 |
2 files changed, 8 insertions, 4 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 |