From 62bce32f6174f6a38f09b7203c0b72a6a174c51e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Isma=C3=ABl=20Bouya?= Date: Tue, 26 Jul 2016 21:29:40 +0200 Subject: [PATCH] Add cleanup when stopping music --- helpers/music_file.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/helpers/music_file.py b/helpers/music_file.py index a972bc5..9976306 100644 --- a/helpers/music_file.py +++ b/helpers/music_file.py @@ -115,6 +115,9 @@ class MusicFile: debug_print("Loaded « {} »".format(self.name)) def on_enter_loaded(self): + self.cleanup() + + def cleanup(self): self.gain_effects = [] self.set_gain(0, absolute=True) self.current_audio_segment = None @@ -136,6 +139,7 @@ class MusicFile: def trigger_stopped_events(self): self.mixer.remove_file(self) self.wait_event.set() + self.cleanup() # Actions and properties called externally @property -- 2.41.0