aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2014-03-20 17:07:27 -0500
committerTed Gould <ted@gould.cx>2014-03-20 17:07:27 -0500
commitc04df47dc6e092e843532c602d367ef315a5d79d (patch)
tree211fee14cb1b1ec2f887e8a46c830ea5cfae9fef
parent9d458fd02cc5180b9728186690026fd296edd9d9 (diff)
downloadayatana-indicator-sound-c04df47dc6e092e843532c602d367ef315a5d79d.tar.gz
ayatana-indicator-sound-c04df47dc6e092e843532c602d367ef315a5d79d.tar.bz2
ayatana-indicator-sound-c04df47dc6e092e843532c602d367ef315a5d79d.zip
Handle sigterm
-rw-r--r--src/service.vala7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/service.vala b/src/service.vala
index df33a62..c8a57ac 100644
--- a/src/service.vala
+++ b/src/service.vala
@@ -101,6 +101,13 @@ public class IndicatorSound.Service: Object {
this.bus_acquired, null, this.name_lost);
this.loop = new MainLoop (null, false);
+
+ GLib.Unix.signal_add(GLib.ProcessSignal.TERM, () => {
+ debug("SIGTERM recieved, stopping our mainloop");
+ this.loop.quit();
+ return false;
+ });
+
this.loop.run ();
return 0;