From 2bbbebbfca3bc95f213c4b0768d4af8c86a1db7a Mon Sep 17 00:00:00 2001 From: "fires.gc" Date: Wed, 5 Nov 2008 22:17:09 +0000 Subject: [PATCH] shutdown fix for wiimote plugin git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1081 8ced0084-cf51-0410-be5f-012b33b47a6e --- .../Plugin_Wiimote_Test/Src/wiimote_real.cpp | 13 +++++++++---- 1 file 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