fix(exit): taskkill rieng tung process — kill het plugin_host/fx_vst_bridge khi thoat app (truoc day /IM gop chi chay lenh dau); CREATE_NO_WINDOW cho moi subprocess engine (het terminal chớp chớp)

This commit is contained in:
2026-08-22 18:06:26 +07:00
parent f143646ba7
commit 14265515aa
6 changed files with 30 additions and 16 deletions
+5 -2
View File
@@ -419,6 +419,7 @@ def _pick_dir_native_engine() -> Optional[str]:
r = subprocess.run(
["powershell", "-NoProfile", "-STA", "-Command", ps],
capture_output=True, text=True, timeout=PICK_DIR_TIMEOUT,
creationflags=subprocess.CREATE_NO_WINDOW,
)
return r.stdout.strip() or None
except Exception:
@@ -798,7 +799,8 @@ async def open_in_carla(req: OpenInCarlaRequest, current_user: dict = Depends(ge
cmd.append(carxs_path)
try:
cwd = os.path.dirname(carla) or None
proc = subprocess.Popen(cmd, cwd=cwd, close_fds=os.name != "nt")
proc = subprocess.Popen(cmd, cwd=cwd, close_fds=os.name != "nt",
creationflags=subprocess.CREATE_NO_WINDOW if os.name == "nt" else 0)
_register_carla_process(proc)
return {
"success": True,
@@ -1778,7 +1780,8 @@ def _running_sonicforge_pids() -> list:
out = subprocess.run(
["powershell", "-NoProfile", "-Command",
"Get-Process sonicforge-daw,daw_engine -ErrorAction SilentlyContinue | Select-Object -ExpandProperty Id"],
capture_output=True, text=True, timeout=10).stdout
capture_output=True, text=True, timeout=10,
creationflags=subprocess.CREATE_NO_WINDOW).stdout
for line in out.splitlines():
line = line.strip()
if line.isdigit():