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

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