aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2015-02-09 22:42:26 -0600
committerTed Gould <ted@gould.cx>2015-02-09 22:42:26 -0600
commit72bbb7eaaf6985840c86cba9e8b07aebe841c3e8 (patch)
tree707508460cb002aa2d1222b02aad56e3e68f13b7 /src
parent92658ca183935e2691acfe84be1464b0b9d43259 (diff)
downloadayatana-indicator-sound-72bbb7eaaf6985840c86cba9e8b07aebe841c3e8.tar.gz
ayatana-indicator-sound-72bbb7eaaf6985840c86cba9e8b07aebe841c3e8.tar.bz2
ayatana-indicator-sound-72bbb7eaaf6985840c86cba9e8b07aebe841c3e8.zip
Make it so that we unexport actions when destroying the object
Diffstat (limited to 'src')
-rw-r--r--src/service.vala12
1 files changed, 11 insertions, 1 deletions
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);
}