From 2664f8bbb3c51967f2eda421c0ff737566fe02b9 Mon Sep 17 00:00:00 2001 From: Gianmarco <31326058+Ladvace@users.noreply.github.com> Date: Mon, 8 Aug 2022 23:54:26 +0200 Subject: [PATCH] fix: kill game parent process (#1419) --- src/app/desktop/components/Instances/Instance.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/app/desktop/components/Instances/Instance.js b/src/app/desktop/components/Instances/Instance.js index bfe410c0e..22e75938e 100644 --- a/src/app/desktop/components/Instances/Instance.js +++ b/src/app/desktop/components/Instances/Instance.js @@ -210,8 +210,8 @@ const Instance = ({ instanceName }) => { dispatch(openModal('InstanceDuplicateName', { instanceName })); }; const killProcess = () => { - console.log(isPlaying.pid); psTree(isPlaying.pid, (err, children) => { + process.kill(isPlaying.pid); if (children?.length) { children.forEach(el => { if (el) { @@ -220,6 +220,11 @@ const Instance = ({ instanceName }) => { } catch { // No-op } + try { + process.kill(el.PPID); + } catch { + // No-op + } } }); } else {