From 72bbb7eaaf6985840c86cba9e8b07aebe841c3e8 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 9 Feb 2015 22:42:26 -0600 Subject: Make it so that we unexport actions when destroying the object --- src/service.vala | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/service.vala b/src/service.vala index c6f318b..da3bf09 100644 --- a/src/service.vala +++ b/src/service.vala @@ -101,6 +101,11 @@ public class IndicatorSound.Service: Object { GLib.Bus.unwatch_name(this.notification_server_watch); this.notification_server_watch = 0; } + + if (this.export_actions != 0) { + bus.unexport_action_group(this.export_actions); + this.export_actions = 0; + } } bool greeter_show_track () { @@ -480,9 +485,14 @@ public class IndicatorSound.Service: Object { return high_volume_action; } + DBusConnection? bus = null; + uint export_actions = 0; + void bus_acquired (DBusConnection connection, string name) { + bus = connection; + try { - connection.export_action_group ("/com/canonical/indicator/sound", this.actions); + export_actions = connection.export_action_group ("/com/canonical/indicator/sound", this.actions); } catch (Error e) { critical ("%s", e.message); } -- cgit v1.2.3