[APU] Only set the work event/wait on the worker thread when they actually exist.
This commit is contained in:
parent
38a6d110e7
commit
53b564c1a6
|
@ -175,15 +175,20 @@ void XmaDecoder::WorkerThreadMain() {
|
|||
|
||||
void XmaDecoder::Shutdown() {
|
||||
worker_running_ = false;
|
||||
|
||||
if (work_event_) {
|
||||
work_event_->Set();
|
||||
}
|
||||
|
||||
if (paused_) {
|
||||
Resume();
|
||||
}
|
||||
|
||||
if (worker_thread_) {
|
||||
// Wait for work thread.
|
||||
xe::threading::Wait(worker_thread_->thread(), false);
|
||||
worker_thread_.reset();
|
||||
}
|
||||
|
||||
if (context_data_first_ptr_) {
|
||||
memory()->SystemHeapFree(context_data_first_ptr_);
|
||||
|
|
Loading…
Reference in New Issue