Fixed Exception when requesting exit

This commit is contained in:
krjan02 2025-01-13 22:34:43 +01:00
parent 5db254e0f1
commit ac41113853

View File

@ -76,12 +76,19 @@ namespace SoraV2Utils_Agent
public void Exit()
{
var client = new Client("SoraV2UtilsDeviceData");
var service = client.GetServiceProxy<IMouseData>();
service.Exit();
// Stop the Service
try
{
var client = new Client("SoraV2UtilsDeviceData");
var service = client.GetServiceProxy<IMouseData>();
service.Exit();
}
catch (TimeoutException)
{
}
// Exit the application gracefully
Environment.Exit(0);
// Exit the application
System.Environment.Exit(1);
}
}
}