EmuInstanceAudio.cpp: Dont open new mic device on audioEnable(). Fixes memory leak when reseting the emu

This commit is contained in:
SachinVin 2024-11-13 23:15:49 +05:30
parent 5e8beb3ab7
commit 974e7e5c16

View File

@ -495,11 +495,11 @@ void EmuInstance::audioUpdateSettings()
void EmuInstance::audioEnable() void EmuInstance::audioEnable()
{ {
if (audioDevice) SDL_PauseAudioDevice(audioDevice, 0); if (audioDevice) SDL_PauseAudioDevice(audioDevice, 0);
micOpen(); if (micDevice) SDL_PauseAudioDevice(micDevice, 0);
} }
void EmuInstance::audioDisable() void EmuInstance::audioDisable()
{ {
if (audioDevice) SDL_PauseAudioDevice(audioDevice, 1); if (audioDevice) SDL_PauseAudioDevice(audioDevice, 1);
micClose(); if (micDevice) SDL_PauseAudioDevice(micDevice, 1);
} }