From 480d998efb8bcd94401ff2d7c40a1fb9b81d8db1 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Wed, 12 Aug 2015 13:16:40 -0500 Subject: in volume-control-pulse, extract methods from ctor and dtor for readability --- src/volume-control-pulse.vala | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/volume-control-pulse.vala b/src/volume-control-pulse.vala index 81938fe..87af258 100644 --- a/src/volume-control-pulse.vala +++ b/src/volume-control-pulse.vala @@ -105,16 +105,26 @@ public class VolumeControlPulse : VolumeControl _mute_cancellable = new Cancellable (); _volume_cancellable = new Cancellable (); - init_max_volume(); - init_high_volume(); - init_high_volume_approved(); + init_all_properties(); setup_accountsservice.begin (); this.reconnect_to_pulse (); } + private void init_all_properties() + { + init_max_volume(); + init_high_volume(); + init_high_volume_approved(); + } + ~VolumeControlPulse () + { + stop_all_timers(); + } + + private void stop_all_timers() { if (_reconnect_timer != 0) { Source.remove (_reconnect_timer); -- cgit v1.2.3