Fix threading problem with AiUpdate

When you reset a game or switch to another game, it keep creating a new
thread even if one already exists. This can cause the emulator to crash.
This commit is contained in:
LegendOfDragoon 2015-05-25 22:05:09 -07:00
parent f5c7fa3bf8
commit 03dae91dc8
1 changed files with 1 additions and 1 deletions

View File

@ -135,7 +135,7 @@ bool CAudioPlugin::Initiate(CN64System * System, CMainGui * RenderWindow)
if (System != NULL)
{
if (AiUpdate)
if (AiUpdate && !m_hAudioThread)
{
m_hAudioThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)AudioThread, (LPVOID)this, 0, &ThreadID);
}