]> kaliko git repositories - mpd-sima.git/blobdiff - sima/core.py
Fixed SIGHUP issue hopefully.
[mpd-sima.git] / sima / core.py
index cf011c7e11edad3606e4a0679d6ce362829e8d77..7a17c5f8844923c3c590648afe4c344954ce5bcd 100644 (file)
@@ -123,14 +123,18 @@ class Sima(Daemon):
 
     def hup_handler(self, signum, frame):
         self.log.warning('Caught a sighup!')
-        self.player.disconnect()
+        # Cleaning pending command
+        self.player.clean()
         self.foreach_plugin('shutdown')
+        self.player.disconnect()
         raise SigHup('SIGHUP caught!')
 
     def shutdown(self):
         """General shutdown method
         """
         self.log.warning('Starting shutdown.')
+        # Cleaning pending command
+        self.player.clean()
         self.foreach_plugin('shutdown')
         self.player.disconnect()