From 7d3ad0b1fec119ecc0030e4e4c545dcce028a9a8 Mon Sep 17 00:00:00 2001 From: Glenn Rice Date: Fri, 25 Feb 2011 05:19:59 +0000 Subject: [PATCH] Fix the hang on windows when wiimote refresh is used during a game. Fixes issue 4161. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7239 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Core/Src/HW/WiimoteReal/IONix.cpp | 3 +++ Source/Core/Core/Src/HW/WiimoteReal/WiimoteReal.cpp | 5 ----- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Source/Core/Core/Src/HW/WiimoteReal/IONix.cpp b/Source/Core/Core/Src/HW/WiimoteReal/IONix.cpp index 0e88c047dc..b01caf06c8 100644 --- a/Source/Core/Core/Src/HW/WiimoteReal/IONix.cpp +++ b/Source/Core/Core/Src/HW/WiimoteReal/IONix.cpp @@ -32,6 +32,7 @@ #include "Common.h" #include "WiimoteReal.h" +#include "Host.h" // Identify the wiimote device by its class #define WM_DEV_CLASS_0 0x04 @@ -194,6 +195,8 @@ void Wiimote::RealDisconnect() if (m_wiimote_thread.joinable()) m_wiimote_thread.join(); + Host_ConnectWiimote(index, false); + close(out_sock); close(in_sock); diff --git a/Source/Core/Core/Src/HW/WiimoteReal/WiimoteReal.cpp b/Source/Core/Core/Src/HW/WiimoteReal/WiimoteReal.cpp index 63cdb7df08..9a2060e14f 100644 --- a/Source/Core/Core/Src/HW/WiimoteReal/WiimoteReal.cpp +++ b/Source/Core/Core/Src/HW/WiimoteReal/WiimoteReal.cpp @@ -22,7 +22,6 @@ #include "IniFile.h" #include "StringUtil.h" #include "Timer.h" -#include "../../Host.h" #include "WiimoteReal.h" @@ -306,8 +305,6 @@ void Wiimote::ThreadFunc() // rumble briefly Rumble(); - Host_ConnectWiimote(index, true); - // main loop while (IsConnected()) { @@ -320,8 +317,6 @@ void Wiimote::ThreadFunc() #endif Common::SleepCurrentThread(1); } - - Host_ConnectWiimote(index, false); } #ifndef _WIN32