From ec790584aa7a7abad1a0cfb63a41eae304ae153e Mon Sep 17 00:00:00 2001 From: skidau Date: Tue, 29 Dec 2009 23:15:23 +0000 Subject: [PATCH] Fixes the crash when closing Dolphin git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4752 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/DolphinWX/Src/FrameTools.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/Source/Core/DolphinWX/Src/FrameTools.cpp b/Source/Core/DolphinWX/Src/FrameTools.cpp index ceeead1752..e8e1407ce9 100644 --- a/Source/Core/DolphinWX/Src/FrameTools.cpp +++ b/Source/Core/DolphinWX/Src/FrameTools.cpp @@ -955,10 +955,17 @@ void CFrame::UpdateGUI() GetMenuBar()->FindItem(IDM_CONNECT_WIIMOTE4)->Enable(Paused && Core::GetStartupParameter().bWii); if (Initialized && Core::GetStartupParameter().bWii) { - GetMenuBar()->FindItem(IDM_CONNECT_WIIMOTE1)->Check(GetUsbPointer()->AccessWiiMote(0x0100)->IsConnected() == 3); - GetMenuBar()->FindItem(IDM_CONNECT_WIIMOTE2)->Check(GetUsbPointer()->AccessWiiMote(0x0101)->IsConnected() == 3); - GetMenuBar()->FindItem(IDM_CONNECT_WIIMOTE3)->Check(GetUsbPointer()->AccessWiiMote(0x0102)->IsConnected() == 3); - GetMenuBar()->FindItem(IDM_CONNECT_WIIMOTE4)->Check(GetUsbPointer()->AccessWiiMote(0x0103)->IsConnected() == 3); + if (GetUsbPointer()->AccessWiiMote(0x0100) != NULL) + GetMenuBar()->FindItem(IDM_CONNECT_WIIMOTE1)->Check(GetUsbPointer()->AccessWiiMote(0x0100)->IsConnected() == 3); + + if (GetUsbPointer()->AccessWiiMote(0x0101) != NULL) + GetMenuBar()->FindItem(IDM_CONNECT_WIIMOTE2)->Check(GetUsbPointer()->AccessWiiMote(0x0101)->IsConnected() == 3); + + if (GetUsbPointer()->AccessWiiMote(0x0102) != NULL) + GetMenuBar()->FindItem(IDM_CONNECT_WIIMOTE3)->Check(GetUsbPointer()->AccessWiiMote(0x0102)->IsConnected() == 3); + + if (GetUsbPointer()->AccessWiiMote(0x0103) != NULL) + GetMenuBar()->FindItem(IDM_CONNECT_WIIMOTE4)->Check(GetUsbPointer()->AccessWiiMote(0x0103)->IsConnected() == 3); } if (Running)