aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2015-02-09 22:45:29 -0600
committerTed Gould <ted@gould.cx>2015-02-09 22:45:29 -0600
commit1f39e5ac1a2e9352c778f4caf2166b6d3b87996f (patch)
tree03358fe42852d6877e183814aa7c3bf7ddba33c0 /src
parent72bbb7eaaf6985840c86cba9e8b07aebe841c3e8 (diff)
downloadayatana-indicator-sound-1f39e5ac1a2e9352c778f4caf2166b6d3b87996f.tar.gz
ayatana-indicator-sound-1f39e5ac1a2e9352c778f4caf2166b6d3b87996f.tar.bz2
ayatana-indicator-sound-1f39e5ac1a2e9352c778f4caf2166b6d3b87996f.zip
Unexport the menu model on object being destroyed
Diffstat (limited to 'src')
-rw-r--r--src/sound-menu.vala12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/sound-menu.vala b/src/sound-menu.vala
index 96dd143..afcc9a4 100644
--- a/src/sound-menu.vala
+++ b/src/sound-menu.vala
@@ -73,9 +73,19 @@ public class SoundMenu: Object
this.greeter_players = (flags & DisplayFlags.GREETER_PLAYERS) != 0;
}
+ ~SoundMenu () {
+ if (export_id != 0) {
+ bus.unexport_menu_model(export_id);
+ export_id = 0;
+ }
+ }
+
+ DBusConnection? bus = null;
+ uint export_id = 0;
+
public void export (DBusConnection connection, string object_path) {
try {
- connection.export_menu_model (object_path, this.root);
+ export_id = connection.export_menu_model (object_path, this.root);
} catch (Error e) {
critical ("%s", e.message);
}