From f0a986eeefbe8a8c2faa29609f8da86a9afa6a0b Mon Sep 17 00:00:00 2001 From: nitsuja Date: Sun, 8 Nov 2009 04:54:58 +0000 Subject: [PATCH] fix occasional crash or corruption when starting up the audio synchronizer --- desmume/src/windows/main.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/desmume/src/windows/main.cpp b/desmume/src/windows/main.cpp index a4255f200..e069b96e8 100644 --- a/desmume/src/windows/main.cpp +++ b/desmume/src/windows/main.cpp @@ -2467,7 +2467,10 @@ int _main() snd_synchmode = GetPrivateProfileInt("Sound","SynchMode",0,IniName); snd_synchmethod = GetPrivateProfileInt("Sound","SynchMethod",0,IniName); - SPU_SetSynchMode(snd_synchmode,snd_synchmethod); + { + Lock lock; + SPU_SetSynchMode(snd_synchmode,snd_synchmethod); + } CommonSettings.DebugConsole = GetPrivateProfileBool("Emulation", "DebugConsole", FALSE, IniName); CommonSettings.UseExtBIOS = GetPrivateProfileBool("BIOS", "UseExtBIOS", FALSE, IniName);