diff --git a/DS4Windows/DS4Control/ControlService.cs b/DS4Windows/DS4Control/ControlService.cs index 3e883d8..97253d7 100644 --- a/DS4Windows/DS4Control/ControlService.cs +++ b/DS4Windows/DS4Control/ControlService.cs @@ -718,6 +718,7 @@ namespace DS4Windows LogDebug("Closing connection to ViGEmBus"); + bool anyUnplugged = false; for (int i = 0, arlength = DS4Controllers.Length; i < arlength; i++) { DS4Device tempDevice = DS4Controllers[i]; @@ -757,6 +758,7 @@ namespace DS4Windows if (tempout != null) { UnplugOutDev(i, tempDevice, true); + anyUnplugged = true; } //outputDevices[i] = null; @@ -787,6 +789,11 @@ namespace DS4Windows Thread.SpinWait(500); } + if (anyUnplugged) + { + Thread.Sleep(OutputSlotManager.DELAY_TIME); + } + stopViGEm(); } diff --git a/DS4Windows/DS4Control/OutputSlotManager.cs b/DS4Windows/DS4Control/OutputSlotManager.cs index 55de585..429a143 100644 --- a/DS4Windows/DS4Control/OutputSlotManager.cs +++ b/DS4Windows/DS4Control/OutputSlotManager.cs @@ -9,7 +9,7 @@ namespace DS4Windows { public class OutputSlotManager { - private const int DELAY_TIME = 500; // measured in ms + public const int DELAY_TIME = 500; // measured in ms private Dictionary deviceDict = new Dictionary(); private Dictionary revDeviceDict = new Dictionary();