From 3b864d63b91f84232bc1504b1e5af8d467cd8a28 Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 28 Jun 2017 15:03:13 +0300 Subject: [PATCH] Fix crash in audio player destructor. --- Telegram/SourceFiles/media/media_audio.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/media/media_audio.cpp b/Telegram/SourceFiles/media/media_audio.cpp index c0e1e9778..fc50b43cb 100644 --- a/Telegram/SourceFiles/media/media_audio.cpp +++ b/Telegram/SourceFiles/media/media_audio.cpp @@ -194,7 +194,9 @@ void Start() { void Finish() { Platform::Audio::DeInit(); - delete base::take(MixerInstance); + // MixerInstance variable should be modified under AudioMutex protection. + // So it is modified in the ~Mixer() destructor after all tracks are cleared. + delete MixerInstance; // No sync required already. ClosePlaybackDevice();