aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2011-02-01 09:35:04 -0600
committerTed Gould <ted@gould.cx>2011-02-01 09:35:04 -0600
commit004f46321f23d5967f698dd1201bc19b8a422dbf (patch)
treecccfc4cb6a75dce7b77d1e96a732c3a683e17311 /src
parent10fb9c744b01451f037466c941f018257a674878 (diff)
downloadayatana-indicator-datetime-004f46321f23d5967f698dd1201bc19b8a422dbf.tar.gz
ayatana-indicator-datetime-004f46321f23d5967f698dd1201bc19b8a422dbf.tar.bz2
ayatana-indicator-datetime-004f46321f23d5967f698dd1201bc19b8a422dbf.zip
Adding more comments
Diffstat (limited to 'src')
-rw-r--r--src/datetime-service.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/datetime-service.c b/src/datetime-service.c
index 04a808a..db887a9 100644
--- a/src/datetime-service.c
+++ b/src/datetime-service.c
@@ -393,6 +393,9 @@ geo_create_address (GeoclueMasterClient * master, GeoclueAddress * address, GErr
return;
}
+ /* We shouldn't have created a new address if we already had one
+ so this is a warning. But, it really is only a mem-leak so we
+ don't need to error out. */
g_warn_if_fail(geo_address == NULL);
g_debug("Created Geoclue Address");
@@ -422,7 +425,8 @@ geo_client_invalid (GeoclueMasterClient * client, gpointer user_data)
{
g_warning("Master client invalid, rebuilding.");
- /* Client changes we can assume the address is invalid */
+ /* Client changes we can assume the address is now invalid so we
+ need to unreference the one we had. */
if (geo_address != NULL) {
g_object_unref(G_OBJECT(geo_address));
}
@@ -453,6 +457,8 @@ geo_address_change (GeoclueMasterClient * client, gchar * a, gchar * b, gchar *
{
g_warning("Address provider changed. Let's change");
+ /* If the address is supposed to have changed we need to drop the old
+ address before starting to get the new one. */
if (geo_address != NULL) {
g_object_unref(G_OBJECT(geo_address));
}