Skip to content

Commit

Permalink
WASAPI: Delete audio_client if initialization failed
Browse files Browse the repository at this point in the history
  • Loading branch information
kus04e4ek committed Jul 12, 2024
1 parent 97b8ad1 commit 138e60e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/wasapi/audio_driver_wasapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,7 @@ Error AudioDriverWASAPI::audio_device_init(AudioDeviceWASAPI *p_device, bool p_i
Error AudioDriverWASAPI::init_output_device(bool p_reinit) {
Error err = audio_device_init(&audio_output, false, p_reinit);
if (err != OK) {
finish_output_device();
return err;
}

Expand Down Expand Up @@ -495,6 +496,7 @@ Error AudioDriverWASAPI::init_output_device(bool p_reinit) {
Error AudioDriverWASAPI::init_input_device(bool p_reinit) {
Error err = audio_device_init(&audio_input, true, p_reinit);
if (err != OK) {
finish_input_device();
return err;
}

Expand Down

0 comments on commit 138e60e

Please sign in to comment.