mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2024-11-23 01:39:17 +01:00
Fixed problem with unplugging controllers causing cross thread problems
This commit is contained in:
parent
0ce20cdfc8
commit
0896f044e8
@ -1047,8 +1047,11 @@ namespace DS4Windows
|
||||
lag[ind] = false;
|
||||
inWarnMonitor[ind] = false;
|
||||
useDInputOnly[ind] = true;
|
||||
OnControllerRemoved(this, ind);
|
||||
Thread.Sleep(XINPUT_UNPLUG_SETTLE_TIME);
|
||||
uiContext?.Post(new SendOrPostCallback((state) =>
|
||||
{
|
||||
OnControllerRemoved(this, ind);
|
||||
}), null);
|
||||
//Thread.Sleep(XINPUT_UNPLUG_SETTLE_TIME);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2174,14 +2174,15 @@ Properties.Resources.DS4Update, MessageBoxButtons.YesNo, MessageBoxIcon.Question
|
||||
|
||||
FormLocationX = Location.X > 0 ? Location.X : 0;
|
||||
FormLocationY = Location.Y > 0 ? Location.Y : 0;
|
||||
Global.ControllerRemoved -= ControllerRemovedChange;
|
||||
|
||||
if (!string.IsNullOrEmpty(appdatapath))
|
||||
{
|
||||
Save();
|
||||
blankControllerTab();
|
||||
Program.rootHub.Stop();
|
||||
}
|
||||
|
||||
TaskRunner.Run(() => Program.rootHub.Stop()).Wait();
|
||||
// Make sure to stop event generation routines. Should fix odd crashes on shutdown
|
||||
Application.Exit();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user