Skip to content

Commit

Permalink
Close USB interfaces only after closing USB threads
Browse files Browse the repository at this point in the history
  • Loading branch information
cathery committed Apr 18, 2020
1 parent 0322aef commit 1705f42
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions source/ControllerSwitch/SwitchAbstractedPadHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down
6 changes: 4 additions & 2 deletions source/ControllerSwitch/SwitchHDLHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down

0 comments on commit 1705f42

Please sign in to comment.