From 30523b570c529d34e23b4198f9b0fd7fef6552e8 Mon Sep 17 00:00:00 2001 From: John Peterson Date: Wed, 28 Jan 2009 16:28:34 +0000 Subject: [PATCH] Wiimote: Avoid the possibility of causing a constant rumble when a game is closed git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2025 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Plugins/Plugin_Wiimote/Src/wiimote_real.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Source/Plugins/Plugin_Wiimote/Src/wiimote_real.cpp b/Source/Plugins/Plugin_Wiimote/Src/wiimote_real.cpp index a88a38327e..63431a5313 100644 --- a/Source/Plugins/Plugin_Wiimote/Src/wiimote_real.cpp +++ b/Source/Plugins/Plugin_Wiimote/Src/wiimote_real.cpp @@ -320,8 +320,15 @@ void Shutdown(void) } #if defined(HAVE_WX) && HAVE_WX - if(frame) frame->ShutDown = true; - if(frame) frame->StartTimer(); + /* We can only do this if we are not unloading the DLL, otherwise we can get stuck with a + a rumble after we Stop a game */ + if (!g_EmulatorRunning) + { + if(frame) frame->ShutDown = true; + if(frame) frame->StartTimer(); + } + else + { #else // Clean up wiiuse wiiuse_cleanup(g_WiiMotesFromWiiUse, g_NumberOfWiiMotes); @@ -329,6 +336,9 @@ void Shutdown(void) // Uninitialized g_RealWiiMoteInitialized = false; #endif + #if defined(HAVE_WX) && HAVE_WX + } + #endif // Uninitialized g_RealWiiMoteInitialized = false;