shutdown fix for wiimote plugin

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1081 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
fires.gc 2008-11-05 22:17:09 +00:00
parent f122106b61
commit 2bbbebbfca
1 changed files with 9 additions and 4 deletions

View File

@ -227,17 +227,22 @@ namespace WiiMoteReal
{ {
g_Shutdown = true; g_Shutdown = true;
// stop the thread
if (g_pReadThread != NULL)
{
g_pReadThread->WaitForDeath(); g_pReadThread->WaitForDeath();
delete g_pReadThread;
g_pReadThread = NULL;
}
// delete the wiimotes
for (int i=0; i<g_NumberOfWiiMotes; i++) for (int i=0; i<g_NumberOfWiiMotes; i++)
{ {
delete g_WiiMotes[i]; delete g_WiiMotes[i];
g_WiiMotes[i] = NULL; g_WiiMotes[i] = NULL;
} }
delete g_pReadThread; // clean up wiiuse
g_pReadThread = NULL;
wiiuse_cleanup(g_WiiMotesFromWiiUse, g_NumberOfWiiMotes); wiiuse_cleanup(g_WiiMotesFromWiiUse, g_NumberOfWiiMotes);
} }