aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2012-06-06 14:47:08 -0500
committerCharles Kerr <charles.kerr@canonical.com>2012-06-06 14:47:08 -0500
commitfcd052a49adf44c55a689a03fd5ced85369c7a5a (patch)
tree6f08ea2731ad8423c2864c4968037c35c59c87d5
parent5cac4ebb939cde67c78cf8aa59d27beafd187ac8 (diff)
downloadayatana-indicator-power-fcd052a49adf44c55a689a03fd5ced85369c7a5a.tar.gz
ayatana-indicator-power-fcd052a49adf44c55a689a03fd5ced85369c7a5a.tar.bz2
ayatana-indicator-power-fcd052a49adf44c55a689a03fd5ced85369c7a5a.zip
if self->cancellable is non-NULL in dispose(), pass it to g_cancellable_cancel() before clearing the listener's reference
-rw-r--r--src/dbus-listener.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/dbus-listener.c b/src/dbus-listener.c
index 4923fe1..34df925 100644
--- a/src/dbus-listener.c
+++ b/src/dbus-listener.c
@@ -110,7 +110,12 @@ indicator_power_dbus_listener_dispose (GObject *object)
IndicatorPowerDbusListenerPrivate * priv = self->priv;
g_clear_object (&priv->proxy);
- g_clear_object (&priv->cancellable);
+
+ if (priv->cancellable != NULL)
+ {
+ g_cancellable_cancel (priv->cancellable);
+ g_clear_object (&priv->cancellable);
+ }
if (priv->watcher_id)
{