diff options
author | Ted Gould <ted@gould.cx> | 2014-03-21 14:26:43 -0500 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2014-03-21 14:26:43 -0500 |
commit | 0f18af8fd8c22b756436a5d7ff8c93e6d9a489a8 (patch) | |
tree | 632ce19a607d5d4b7931287d86356a624b3f835e /src | |
parent | 0ef1cba5e195c4d92b7dd5753cb88f072aa9f297 (diff) | |
download | ayatana-indicator-sound-0f18af8fd8c22b756436a5d7ff8c93e6d9a489a8.tar.gz ayatana-indicator-sound-0f18af8fd8c22b756436a5d7ff8c93e6d9a489a8.tar.bz2 ayatana-indicator-sound-0f18af8fd8c22b756436a5d7ff8c93e6d9a489a8.zip |
Move all the clearing of the player into one place
Diffstat (limited to 'src')
-rw-r--r-- | src/service.vala | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/service.vala b/src/service.vala index 8b83082..bfd4115 100644 --- a/src/service.vala +++ b/src/service.vala @@ -67,11 +67,7 @@ public class IndicatorSound.Service: Object { } void build_accountsservice () { - /* NOTE: This is a bit of a hack to ensure that accounts service doesn't - continue to export the player by keeping a ref in the timer */ - if (this.accounts_service != null) - this.accounts_service.player = null; - + clear_acts_player(); this.accounts_service = null; /* If we're not exporting, don't build anything */ @@ -91,6 +87,13 @@ public class IndicatorSound.Service: Object { this.eventually_update_player_actions(); } + void clear_acts_player () { + /* NOTE: This is a bit of a hack to ensure that accounts service doesn't + continue to export the player by keeping a ref in the timer */ + if (this.accounts_service != null) + this.accounts_service.player = null; + } + public int run () { if (this.loop != null) { warning ("service is already running"); @@ -110,9 +113,7 @@ public class IndicatorSound.Service: Object { this.loop.run (); - /* Ensure we clear the player right after the mainloop quits */ - if (this.accounts_service != null) - this.accounts_service.player = null; + clear_acts_player(); return 0; } @@ -400,9 +401,8 @@ public class IndicatorSound.Service: Object { } } - if (clear_accounts_player && accounts_service != null) { - accounts_service.player = null; - } + if (clear_accounts_player) + clear_acts_player(); this.player_action_update_id = 0; return false; |