diff options
| author | fires.gc <fires.gc@gmail.com> | 2008-11-05 22:17:09 +0000 |
|---|---|---|
| committer | fires.gc <fires.gc@gmail.com> | 2008-11-05 22:17:09 +0000 |
| commit | 2bbbebbfca3bc95f213c4b0768d4af8c86a1db7a (patch) | |
| tree | 0a10a265463a9d85b7bc58b6e888c4872498acd9 | |
| parent | f122106b615a453e6ba13d366229e6d4ceb138f2 (diff) | |
shutdown fix for wiimote plugin
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1081 8ced0084-cf51-0410-be5f-012b33b47a6e
| -rw-r--r-- | Source/Plugins/Plugin_Wiimote_Test/Src/wiimote_real.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/Source/Plugins/Plugin_Wiimote_Test/Src/wiimote_real.cpp b/Source/Plugins/Plugin_Wiimote_Test/Src/wiimote_real.cpp index 1d41b0c890..752d501ec6 100644 --- a/Source/Plugins/Plugin_Wiimote_Test/Src/wiimote_real.cpp +++ b/Source/Plugins/Plugin_Wiimote_Test/Src/wiimote_real.cpp @@ -227,17 +227,22 @@ namespace WiiMoteReal {
g_Shutdown = true;
- g_pReadThread->WaitForDeath();
+ // stop the thread
+ if (g_pReadThread != NULL)
+ {
+ g_pReadThread->WaitForDeath();
+ delete g_pReadThread;
+ g_pReadThread = NULL;
+ }
+ // delete the wiimotes
for (int i=0; i<g_NumberOfWiiMotes; i++)
{
delete g_WiiMotes[i];
g_WiiMotes[i] = NULL;
}
- delete g_pReadThread;
- g_pReadThread = NULL;
-
+ // clean up wiiuse
wiiuse_cleanup(g_WiiMotesFromWiiUse, g_NumberOfWiiMotes);
}
|
