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