mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2024-11-22 09:19:18 +01:00
Change how abort clause is handled for unhandled input thread exceptions
This commit is contained in:
parent
3eb15f1500
commit
40c0a58ab1
@ -188,6 +188,7 @@ namespace DS4WinWPF
|
||||
{
|
||||
Dispatcher.Invoke(() =>
|
||||
{
|
||||
rootHub.PrepareAbort();
|
||||
CleanShutdown();
|
||||
});
|
||||
}
|
||||
|
@ -688,6 +688,18 @@ namespace DS4Windows
|
||||
}
|
||||
}
|
||||
|
||||
public void PrepareAbort()
|
||||
{
|
||||
for (int i = 0, arlength = DS4Controllers.Length; i < arlength; i++)
|
||||
{
|
||||
DS4Device tempDevice = DS4Controllers[i];
|
||||
if (tempDevice != null)
|
||||
{
|
||||
tempDevice.PrepareAbort();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public bool Stop(bool showlog = true)
|
||||
{
|
||||
if (running)
|
||||
|
@ -608,9 +608,8 @@ namespace DS4Windows
|
||||
try
|
||||
{
|
||||
exitInputThread = true;
|
||||
if (ds4Input.ThreadState.HasFlag(System.Threading.ThreadState.WaitSleepJoin))
|
||||
ds4Input.Interrupt();
|
||||
else
|
||||
//ds4Input.Interrupt();
|
||||
if (!abortInputThread)
|
||||
ds4Input.Join();
|
||||
}
|
||||
catch (Exception e)
|
||||
@ -1582,5 +1581,11 @@ namespace DS4Windows
|
||||
{
|
||||
return !test.Equals(blankSerial);
|
||||
}
|
||||
|
||||
private bool abortInputThread = false;
|
||||
public void PrepareAbort()
|
||||
{
|
||||
abortInputThread = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user