chore: 通过进程名关闭蓝叠时如果模拟器个数超过1个则放弃关闭

This commit is contained in:
uye
2023-09-20 15:36:12 +08:00
parent 9100a00411
commit 4f5343aa41

View File

@@ -1542,9 +1542,16 @@ namespace MaaWpfGui.ViewModels.UI
return true;
}
_logger.Information("Info: Failed to kill emulator by the port, try to kill emulator process with PID.");
if (processes.Length > 1)
{
_logger.Warning("Warning: The number of elements in processes exceeds one, abort closing the emulator");
return false;
}
try
{
_logger.Information("Info: Failed to kill emulator by the port, try to kill emulator process with PID.");
processes[0].Kill();
return processes[0].WaitForExit(20000);
}