summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Kuhn <suraia@ikkoku.de>2014-01-22 09:56:02 +0100
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2014-01-22 11:46:27 +0000
commit4d107b2c4b2a5161b6e113fb60e283017b700255 (patch)
treeec86a1128a68afe0523b37abecd6a04a6eae7c12
parent07955827bba3ed6a6426ca4f2cb32efef2dc04c0 (diff)
downloadtelepathy-mission-control-4d107b2c4b2a5161b6e113fb60e283017b700255.tar.gz
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@collabora.co.uk>
-rw-r--r--src/connectivity-monitor.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/connectivity-monitor.c b/src/connectivity-monitor.c
index 682dfa19..8b3d3856 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
{