[Pkg-telepathy-commits] [telepathy-mission-control-5] 10/16: Release inhibitor on sleep and shutdown.

Simon McVittie smcv at debian.org
Mon Jan 27 14:50:23 UTC 2014


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to branch debian
in repository telepathy-mission-control-5.

commit 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
         {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-telepathy/telepathy-mission-control-5.git



More information about the Pkg-telepathy-commits mailing list