From 4f5343aa41b384beecbeeb9a628f5cef3466ca2d Mon Sep 17 00:00:00 2001 From: uye <99072975+ABA2396@users.noreply.github.com> Date: Wed, 20 Sep 2023 15:36:12 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E9=80=9A=E8=BF=87=E8=BF=9B=E7=A8=8B?= =?UTF-8?q?=E5=90=8D=E5=85=B3=E9=97=AD=E8=93=9D=E5=8F=A0=E6=97=B6=E5=A6=82?= =?UTF-8?q?=E6=9E=9C=E6=A8=A1=E6=8B=9F=E5=99=A8=E4=B8=AA=E6=95=B0=E8=B6=85?= =?UTF-8?q?=E8=BF=871=E4=B8=AA=E5=88=99=E6=94=BE=E5=BC=83=E5=85=B3?= =?UTF-8?q?=E9=97=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/MaaWpfGui/ViewModels/UI/TaskQueueViewModel.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/MaaWpfGui/ViewModels/UI/TaskQueueViewModel.cs b/src/MaaWpfGui/ViewModels/UI/TaskQueueViewModel.cs index 7bbd3e5102..37ea6b808b 100644 --- a/src/MaaWpfGui/ViewModels/UI/TaskQueueViewModel.cs +++ b/src/MaaWpfGui/ViewModels/UI/TaskQueueViewModel.cs @@ -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); }