From 22d66f51a8920603eb918d8ed901f3fd108a1127 Mon Sep 17 00:00:00 2001 From: Soren Jorvang Date: Wed, 12 Jan 2011 01:27:01 +0000 Subject: [PATCH] Have wxWidgets install signal handlers to catch crashes and disconnect any wiimotes. The Windows code has special handling of both exceptions and bluetooth connection state, neither of which I really understand, so this is enabled on the other platforms only. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6821 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/DolphinWX/Src/Main.cpp | 7 +++++++ Source/Core/DolphinWX/Src/Main.h | 1 + 2 files changed, 8 insertions(+) diff --git a/Source/Core/DolphinWX/Src/Main.cpp b/Source/Core/DolphinWX/Src/Main.cpp index a1339198a1..c9d5953356 100644 --- a/Source/Core/DolphinWX/Src/Main.cpp +++ b/Source/Core/DolphinWX/Src/Main.cpp @@ -175,6 +175,8 @@ bool DolphinApp::OnInit() #ifdef _WIN32 EXTENDEDTRACEINITIALIZE("."); SetUnhandledExceptionFilter(&MyUnhandledExceptionFilter); +#else + wxHandleFatalExceptions(true); #endif // TODO: if First Boot @@ -423,6 +425,11 @@ int DolphinApp::OnExit() return wxApp::OnExit(); } +void DolphinApp::OnFatalException() +{ + WiimoteReal::Shutdown(); +} + // ------------ // Talk to GUI diff --git a/Source/Core/DolphinWX/Src/Main.h b/Source/Core/DolphinWX/Src/Main.h index aaff98719b..358b465253 100644 --- a/Source/Core/DolphinWX/Src/Main.h +++ b/Source/Core/DolphinWX/Src/Main.h @@ -28,6 +28,7 @@ public: bool OnInit(); void OnEndSession(); int OnExit(); + void OnFatalException(); CFrame* GetCFrame(); void InitLanguageSupport();