From 1705f4213f7a3b0b6f5deeebfa9a9a6aa040e29e Mon Sep 17 00:00:00 2001 From: cathery Date: Sat, 18 Apr 2020 19:05:23 +0300 Subject: [PATCH] Close USB interfaces only after closing USB threads --- source/ControllerSwitch/SwitchAbstractedPadHandler.cpp | 6 ++++-- source/ControllerSwitch/SwitchHDLHandler.cpp | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/source/ControllerSwitch/SwitchAbstractedPadHandler.cpp b/source/ControllerSwitch/SwitchAbstractedPadHandler.cpp index b9a59e6..1410fa4 100644 --- a/source/ControllerSwitch/SwitchAbstractedPadHandler.cpp +++ b/source/ControllerSwitch/SwitchAbstractedPadHandler.cpp @@ -42,13 +42,15 @@ Result SwitchAbstractedPadHandler::Initialize() void SwitchAbstractedPadHandler::Exit() { - m_controllerHandler.Exit(); - if (DoesControllerSupport(GetController()->GetType(), SUPPORTS_NOTHING)) + { + m_controllerHandler.Exit(); return; + } ExitInputThread(); ExitOutputThread(); + m_controllerHandler.Exit(); ExitAbstractedPadState(); } diff --git a/source/ControllerSwitch/SwitchHDLHandler.cpp b/source/ControllerSwitch/SwitchHDLHandler.cpp index aa58a09..6a8dd4c 100644 --- a/source/ControllerSwitch/SwitchHDLHandler.cpp +++ b/source/ControllerSwitch/SwitchHDLHandler.cpp @@ -41,13 +41,15 @@ Result SwitchHDLHandler::Initialize() void SwitchHDLHandler::Exit() { - m_controllerHandler.Exit(); - if (DoesControllerSupport(GetController()->GetType(), SUPPORTS_NOTHING)) + { + m_controllerHandler.Exit(); return; + } ExitInputThread(); ExitOutputThread(); + m_controllerHandler.Exit(); ExitHdlState(); }