diff options
author | Pierre-Luc Beaudoin <pierre-luc.beaudoin@collabora.co.uk> | 2009-06-16 04:30:35 +0800 |
---|---|---|
committer | Pierre-Luc Beaudoin <pierre-luc.beaudoin@collabora.co.uk> | 2009-06-18 00:05:19 +0800 |
commit | 8f7597bb501d2e641b09f55769990df97576cd0f (patch) | |
tree | 97622958015a2d5a65a603441f6466a79da5c8e7 /libempathy-gtk | |
parent | 0f4c81cabf14b37cebef3f4c22f9bdc3ce5238b3 (diff) | |
download | gsoc2013-empathy-8f7597bb501d2e641b09f55769990df97576cd0f.tar gsoc2013-empathy-8f7597bb501d2e641b09f55769990df97576cd0f.tar.gz gsoc2013-empathy-8f7597bb501d2e641b09f55769990df97576cd0f.tar.bz2 gsoc2013-empathy-8f7597bb501d2e641b09f55769990df97576cd0f.tar.lz gsoc2013-empathy-8f7597bb501d2e641b09f55769990df97576cd0f.tar.xz gsoc2013-empathy-8f7597bb501d2e641b09f55769990df97576cd0f.tar.zst gsoc2013-empathy-8f7597bb501d2e641b09f55769990df97576cd0f.zip |
Fix 585887: "Publish my location" causes a crash
Adds more error handling on geoclue init and the geoclue_is_setup check
was too late in update_resources
Diffstat (limited to 'libempathy-gtk')
-rw-r--r-- | libempathy-gtk/empathy-location-manager.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/libempathy-gtk/empathy-location-manager.c b/libempathy-gtk/empathy-location-manager.c index 2e45ab688..278af72f2 100644 --- a/libempathy-gtk/empathy-location-manager.c +++ b/libempathy-gtk/empathy-location-manager.c @@ -452,6 +452,9 @@ update_resources (EmpathyLocationManager *location_manager) DEBUG ("Updating resources %d", priv->resources); + if (!priv->geoclue_is_setup) + return; + /* As per Geoclue bug #15126, using NONE results in no address * being found as geoclue-manual report an empty address with * accuracy = NONE */ @@ -463,9 +466,6 @@ update_resources (EmpathyLocationManager *location_manager) return; } - if (!priv->geoclue_is_setup) - return; - geoclue_address_get_address_async (priv->gc_address, initial_address_cb, location_manager); geoclue_position_get_position_async (priv->gc_position, @@ -482,9 +482,16 @@ setup_geoclue (EmpathyLocationManager *location_manager) DEBUG ("Setting up Geoclue"); master = geoclue_master_get_default (); - priv->gc_client = geoclue_master_create_client (master, NULL, NULL); + priv->gc_client = geoclue_master_create_client (master, NULL, &error); g_object_unref (master); + if (priv->gc_client == NULL) + { + DEBUG ("Failed to GeoclueMasterClient: %s", error->message); + g_error_free (error); + return; + } + update_resources (location_manager); /* Get updated when the position is changes */ |