aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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)
{