diff --git a/reactos/base/applications/sndvol32/mixer.c b/reactos/base/applications/sndvol32/mixer.c index 16b2a1644a8..ff2185f3f87 100644 --- a/reactos/base/applications/sndvol32/mixer.c +++ b/reactos/base/applications/sndvol32/mixer.c @@ -90,6 +90,7 @@ SndMixerCreate(HWND hWndNotification) VOID SndMixerDestroy(PSND_MIXER Mixer) { + ClearMixerCache(Mixer); SndMixerClose(Mixer); HeapFree(GetProcessHeap(), 0, diff --git a/reactos/base/applications/sndvol32/sndvol32.c b/reactos/base/applications/sndvol32/sndvol32.c index e31f43eb16c..f060050b78b 100644 --- a/reactos/base/applications/sndvol32/sndvol32.c +++ b/reactos/base/applications/sndvol32/sndvol32.c @@ -1018,9 +1018,13 @@ MainWindowProc(HWND hwnd, { MixerWindow = GetWindowData(hwnd, MIXER_WINDOW); - if (MixerWindow->Mixer != NULL) + if (MixerWindow != NULL) { - SndMixerDestroy(MixerWindow->Mixer); + if (MixerWindow->Mixer != NULL) + { + SndMixerDestroy(MixerWindow->Mixer); + } + HeapFree(hAppHeap, 0, MixerWindow); } break; }