diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-01-31 15:24:56 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-31 15:24:56 +0100 |
commit | 5525cd85c60455b0bb9716bbef0ad2ad8111d752 (patch) | |
tree | 52ff0e2d3e01dd2655feff1cf88f07e10d84aad1 /drivers/wasapi/audio_driver_wasapi.cpp | |
parent | 02eb11450b4151b02db861b5029783e52e16c603 (diff) | |
parent | 99fe462452be44efa618e83ad9bbecd722ae6ecd (diff) |
Merge pull request #45315 from RandomShaper/modernize_thread
Modernize Thread
Diffstat (limited to 'drivers/wasapi/audio_driver_wasapi.cpp')
-rw-r--r-- | drivers/wasapi/audio_driver_wasapi.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/wasapi/audio_driver_wasapi.cpp b/drivers/wasapi/audio_driver_wasapi.cpp index 7d5082d276..f2d541754f 100644 --- a/drivers/wasapi/audio_driver_wasapi.cpp +++ b/drivers/wasapi/audio_driver_wasapi.cpp @@ -397,7 +397,7 @@ Error AudioDriverWASAPI::init() { exit_thread = false; thread_exited = false; - thread = Thread::create(thread_func, this); + thread.start(thread_func, this); return OK; } @@ -767,13 +767,8 @@ void AudioDriverWASAPI::unlock() { } void AudioDriverWASAPI::finish() { - if (thread) { - exit_thread = true; - Thread::wait_to_finish(thread); - - memdelete(thread); - thread = nullptr; - } + exit_thread = true; + thread.wait_to_finish(); finish_capture_device(); finish_render_device(); |