aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2014-03-21 14:26:43 -0500
committerTed Gould <ted@gould.cx>2014-03-21 14:26:43 -0500
commit0f18af8fd8c22b756436a5d7ff8c93e6d9a489a8 (patch)
tree632ce19a607d5d4b7931287d86356a624b3f835e
parent0ef1cba5e195c4d92b7dd5753cb88f072aa9f297 (diff)
downloadayatana-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
-rw-r--r--src/service.vala22
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;