From fd4125d964dc42936d3fb8b3249d1e882f4ad38f Mon Sep 17 00:00:00 2001 From: ed Date: Fri, 21 Jun 2019 18:00:48 +0100 Subject: [PATCH] WASAPI: Fixed a double-deletion crash on older versions of Windows --- modules/juce_audio_devices/native/juce_win32_WASAPI.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/juce_audio_devices/native/juce_win32_WASAPI.cpp b/modules/juce_audio_devices/native/juce_win32_WASAPI.cpp index def3648a8c..877aaa129b 100644 --- a/modules/juce_audio_devices/native/juce_win32_WASAPI.cpp +++ b/modules/juce_audio_devices/native/juce_win32_WASAPI.cpp @@ -454,6 +454,10 @@ public: if (client != nullptr) client->Stop(); + // N.B. this is needed to prevent a double-deletion of the IAudioSessionEvents object + // on older versions of Windows + Thread::sleep (5); + deleteSessionEventCallback(); client = nullptr; ResetEvent (clientEvent);