[telepathy-mission-control-5.16] telepathy-mission-control: Release inhibitor on sleep and shutdown.

Simon McVittie smcv at kemper.freedesktop.org
Wed Jan 22 03:52:19 PST 2014


Module: telepathy-mission-control
Branch: telepathy-mission-control-5.16
Commit: 4d107b2c4b2a5161b6e113fb60e283017b700255
URL:    http://cgit.freedesktop.org/telepathy/telepathy-mission-control/commit/?id=4d107b2c4b2a5161b6e113fb60e283017b700255

Author: Michael Kuhn <suraia at ikkoku.de>
Date:   Wed Jan 22 09:56:02 2014 +0100

Release inhibitor on sleep and shutdown.

Also fix a memory leak in login1_inhibit_cb.

[The intention was to hold one "ref" to the inhibit fd for each
connection that was waiting to disconnect, plus one "ref" for the
idle state of "waiting to be notified by logind". We correctly took
one "ref" per connection, but did not release the extra one. -smcv]

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=73599
Reviewed-by: Simon McVittie <simon.mcvittie at collabora.co.uk>

---

 src/connectivity-monitor.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/connectivity-monitor.c b/src/connectivity-monitor.c
index 682dfa1..8b3d385 100644
--- a/src/connectivity-monitor.c
+++ b/src/connectivity-monitor.c
@@ -343,6 +343,8 @@ login1_inhibit_cb (GObject *source G_GNUC_UNUSED,
         {
           DEBUG ("Inhibit() didn't return enough fds?");
         }
+
+      g_variant_unref (tuple);
     }
   else
     {
@@ -400,6 +402,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
         {
@@ -440,6 +443,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
         {



More information about the telepathy-commits mailing list