From ed0e8925a491783f3120a0a1cc1f561690af624d Mon Sep 17 00:00:00 2001 From: tomcw Date: Sat, 20 Jun 2015 12:33:45 -0700 Subject: [PATCH] Fix ASSERT when disabling/enabling soundtype (#295) --- source/Speaker.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/Speaker.cpp b/source/Speaker.cpp index 6b48186e..3459cb93 100644 --- a/source/Speaker.cpp +++ b/source/Speaker.cpp @@ -223,7 +223,7 @@ void SpkrDestroy () g_pSpeakerBuffer = NULL; g_pRemainderBuffer = NULL; } - else + else if (soundtype == SOUND_DIRECT || soundtype == SOUND_SMART) { InternalBeep(0,0); } @@ -325,8 +325,8 @@ void SpkrReset() BOOL SpkrSetEmulationType (HWND window, DWORD newtype) { - if (soundtype != SOUND_NONE) - SpkrDestroy(); + SpkrDestroy(); // GH#295: Destroy for all types (even SOUND_NONE) + soundtype = newtype; if (soundtype != SOUND_NONE) SpkrInitialize();