From a024d045836642595ab325c7616abc9e22332495 Mon Sep 17 00:00:00 2001 From: Braden Date: Thu, 15 Nov 2012 21:30:19 -0600 Subject: [PATCH] Patch by mwessel that fixes real wiimotes on OSX 10.8 --- Source/Core/Core/Src/HW/WiimoteReal/IOdarwin.mm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Source/Core/Core/Src/HW/WiimoteReal/IOdarwin.mm b/Source/Core/Core/Src/HW/WiimoteReal/IOdarwin.mm index 8e3586f7d9..9ee39e5b92 100644 --- a/Source/Core/Core/Src/HW/WiimoteReal/IOdarwin.mm +++ b/Source/Core/Core/Src/HW/WiimoteReal/IOdarwin.mm @@ -185,6 +185,11 @@ bool Wiimote::Connect() RealDisconnect(); return false; } + + // As of 10.8 these need explicit retaining or writing to the wiimote has a very high + // chance of crashing and burning. + [ichan retain]; + [cchan retain]; NOTICE_LOG(WIIMOTE, "Connected to wiimote %i at %s", index + 1, [[btd getAddressString] UTF8String]); @@ -215,7 +220,8 @@ void Wiimote::RealDisconnect() m_wiimote_thread.join(); [btd closeConnection]; - + [ichan release]; + [cchan release]; btd = NULL; cchan = NULL; ichan = NULL;