From b96cf39f6f612422595bc8602ddeaa420e2fe12e Mon Sep 17 00:00:00 2001 From: Michael Kuhn Date: Wed, 22 Jan 2014 09:56:02 +0100 Subject: [PATCH] Release inhibitor on sleep and shutdown. Also fix a memory leak in login1_inhibit_cb. --- src/connectivity-monitor.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/connectivity-monitor.c b/src/connectivity-monitor.c index 286d73e..288d6f5 100644 --- a/src/connectivity-monitor.c +++ b/src/connectivity-monitor.c @@ -298,6 +298,8 @@ login1_inhibit_cb (GObject *source G_GNUC_UNUSED, { DEBUG ("Inhibit() didn't return enough fds?"); } + + g_variant_unref (tuple); } else { @@ -355,6 +357,7 @@ login1_prepare_for_sleep_cb (GDBusConnection *system_bus G_GNUC_UNUSED, DEBUG ("about to suspend"); connectivity_monitor_remove_states (self, CONNECTIVITY_AWAKE, self->priv->login1_inhibit); + tp_clear_pointer (&self->priv->login1_inhibit, mcd_inhibit_release); } else { @@ -395,6 +398,7 @@ login1_prepare_for_shutdown_cb (GDBusConnection *system_bus G_GNUC_UNUSED, DEBUG ("about to shut down"); connectivity_monitor_remove_states (self, CONNECTIVITY_RUNNING, self->priv->login1_inhibit); + tp_clear_pointer (&self->priv->login1_inhibit, mcd_inhibit_release); } else { -- 1.8.5.3