aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2013-10-25 15:17:07 +0000
committerTarmac <Unknown>2013-10-25 15:17:07 +0000
commitdd48ee78afe56d2db5fa22de62a4808eb5fc8276 (patch)
treeef9d6e4f0235a0dbd40a59c1b4dbed7d5597de60
parent44724ab7eca2a0a7e34d5373191c887f17cdef32 (diff)
parent6f243f49bb29f00211c892eee5e696d6ef50db2d (diff)
downloadayatana-indicator-sound-dd48ee78afe56d2db5fa22de62a4808eb5fc8276.tar.gz
ayatana-indicator-sound-dd48ee78afe56d2db5fa22de62a4808eb5fc8276.tar.bz2
ayatana-indicator-sound-dd48ee78afe56d2db5fa22de62a4808eb5fc8276.zip
In Service's volume_changed() function, explicitly instantiate the GVariant to avoid leaking it. See the description in bug #1244468 for before & after C code and more information. Fixes: https://bugs.launchpad.net/bugs/1244468.
Approved by Lars Uebernickel, PS Jenkins bot.
-rw-r--r--src/service.vala14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/service.vala b/src/service.vala
index 0b1ec77..aa992ff 100644
--- a/src/service.vala
+++ b/src/service.vala
@@ -175,10 +175,10 @@ public class IndicatorSound.Service {
}
Action create_mute_action () {
- var mute_action = new SimpleAction.stateful ("mute", null, this.volume_control.mute);
+ var mute_action = new SimpleAction.stateful ("mute", null, new Variant.boolean (this.volume_control.mute));
mute_action.activate.connect ( (action, param) => {
- action.change_state (!action.get_state ().get_boolean ());
+ action.change_state (new Variant.boolean (!action.get_state ().get_boolean ()));
});
mute_action.change_state.connect ( (action, val) => {
@@ -186,7 +186,7 @@ public class IndicatorSound.Service {
});
this.volume_control.notify["mute"].connect ( () => {
- mute_action.set_state (this.volume_control.mute);
+ mute_action.set_state (new Variant.boolean (this.volume_control.mute));
this.update_root_icon ();
});
@@ -195,13 +195,13 @@ public class IndicatorSound.Service {
void volume_changed (double volume) {
var volume_action = this.actions.lookup_action ("volume") as SimpleAction;
- volume_action.set_state (volume);
+ volume_action.set_state (new Variant.double (volume));
this.update_root_icon ();
}
Action create_volume_action () {
- var volume_action = new SimpleAction.stateful ("volume", VariantType.INT32, this.volume_control.get_volume ());
+ var volume_action = new SimpleAction.stateful ("volume", VariantType.INT32, new Variant.double (this.volume_control.get_volume ()));
volume_action.change_state.connect ( (action, val) => {
volume_control.set_volume (val.get_double ());
@@ -221,14 +221,14 @@ public class IndicatorSound.Service {
}
Action create_mic_volume_action () {
- var volume_action = new SimpleAction.stateful ("mic-volume", null, this.volume_control.get_mic_volume ());
+ var volume_action = new SimpleAction.stateful ("mic-volume", null, new Variant.double (this.volume_control.get_mic_volume ()));
volume_action.change_state.connect ( (action, val) => {
volume_control.set_mic_volume (val.get_double ());
});
this.volume_control.mic_volume_changed.connect ( (volume) => {
- volume_action.set_state (volume);
+ volume_action.set_state (new Variant.double (volume));
});
this.volume_control.bind_property ("ready", volume_action, "enabled", BindingFlags.SYNC_CREATE);