mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2024-11-23 09:49:16 +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;
|
lag[ind] = false;
|
||||||
inWarnMonitor[ind] = false;
|
inWarnMonitor[ind] = false;
|
||||||
useDInputOnly[ind] = true;
|
useDInputOnly[ind] = true;
|
||||||
|
uiContext?.Post(new SendOrPostCallback((state) =>
|
||||||
|
{
|
||||||
OnControllerRemoved(this, ind);
|
OnControllerRemoved(this, ind);
|
||||||
Thread.Sleep(XINPUT_UNPLUG_SETTLE_TIME);
|
}), 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;
|
FormLocationX = Location.X > 0 ? Location.X : 0;
|
||||||
FormLocationY = Location.Y > 0 ? Location.Y : 0;
|
FormLocationY = Location.Y > 0 ? Location.Y : 0;
|
||||||
|
Global.ControllerRemoved -= ControllerRemovedChange;
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(appdatapath))
|
if (!string.IsNullOrEmpty(appdatapath))
|
||||||
{
|
{
|
||||||
Save();
|
Save();
|
||||||
blankControllerTab();
|
blankControllerTab();
|
||||||
Program.rootHub.Stop();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TaskRunner.Run(() => Program.rootHub.Stop()).Wait();
|
||||||
// Make sure to stop event generation routines. Should fix odd crashes on shutdown
|
// Make sure to stop event generation routines. Should fix odd crashes on shutdown
|
||||||
Application.Exit();
|
Application.Exit();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user