From 54e1024e54af7f8e3aca6fa88a32a4418129e658 Mon Sep 17 00:00:00 2001 From: ferris Date: Fri, 14 Jun 2013 21:13:49 +0200 Subject: [PATCH] Fixed potential shutdown crash bug --- Chip8/Apu.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Chip8/Apu.cpp b/Chip8/Apu.cpp index 798dc0d..54b2f89 100644 --- a/Chip8/Apu.cpp +++ b/Chip8/Apu.cpp @@ -15,10 +15,12 @@ Apu::~Apu() void Apu::SetAudioDriver(IAudioDriver *audioDriver) { + mutex->Lock(); auto oldAudioDriver = this->audioDriver; if (oldAudioDriver) oldAudioDriver->SetRenderCallback(nullptr, nullptr); this->audioDriver = audioDriver; audioDriver->SetRenderCallback(renderCallbackRouter, this); + mutex->Unlock(); } void Apu::SetBeeping(bool beeping)