From 2d9556d21bfdcd82462e147b1676e22efcb2869a Mon Sep 17 00:00:00 2001 From: LmeSzinc <37934724+LmeSzinc@users.noreply.github.com> Date: Wed, 12 Feb 2025 01:20:18 +0800 Subject: [PATCH] Fix: [ALAS] Emulator tree-killed when Alas gets killed --- module/device/platform/platform_windows.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/module/device/platform/platform_windows.py b/module/device/platform/platform_windows.py index 0936d93fe..ef1db201a 100644 --- a/module/device/platform/platform_windows.py +++ b/module/device/platform/platform_windows.py @@ -54,7 +54,9 @@ class PlatformWindows(PlatformBase, EmulatorManager): """ command = command.replace(r"\\", "/").replace("\\", "/").replace('"', '"') logger.info(f'Execute: {command}') - return subprocess.Popen(command, close_fds=True) # only work on Windows + # `close_fds` only work on Windows + # `start_new_session` to avoid emulator getting tree-killed when Alas gets killed + return subprocess.Popen(command, close_fds=True, start_new_session=True) @classmethod def kill_process_by_regex(cls, regex: str) -> int: