From 38a6d110e7aab35abeef2ba8d1f8bdc9116b84e0 Mon Sep 17 00:00:00 2001 From: gibbed Date: Sun, 4 Aug 2019 00:27:49 -0500 Subject: [PATCH] [APU] Only wait on the worker thread if it actually exists. --- src/xenia/apu/audio_system.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/xenia/apu/audio_system.cc b/src/xenia/apu/audio_system.cc index f37084ce1..befbca4d6 100644 --- a/src/xenia/apu/audio_system.cc +++ b/src/xenia/apu/audio_system.cc @@ -158,8 +158,10 @@ void AudioSystem::Initialize() {} void AudioSystem::Shutdown() { worker_running_ = false; shutdown_event_->Set(); - worker_thread_->Wait(0, 0, 0, nullptr); - worker_thread_.reset(); + if (worker_thread_) { + worker_thread_->Wait(0, 0, 0, nullptr); + worker_thread_.reset(); + } } X_STATUS AudioSystem::RegisterClient(uint32_t callback, uint32_t callback_arg,