Skip to content

Commit

Permalink
fix: kill game parent process (#1419)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ladvace authored Aug 8, 2022
1 parent 3a3b4f5 commit 2664f8b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/app/desktop/components/Instances/Instance.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -220,6 +220,11 @@ const Instance = ({ instanceName }) => {
} catch {
// No-op
}
try {
process.kill(el.PPID);
} catch {
// No-op
}
}
});
} else {
Expand Down

0 comments on commit 2664f8b

Please sign in to comment.