Skip to content

Commit a1c1024

Browse files
[FIX] Proper kill wine processes when hitting Stop Button (#2666)
1 parent 3a9fceb commit a1c1024

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

src/backend/storeManagers/gog/games.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -848,7 +848,7 @@ export async function stop(appName: string, stopWine = true): Promise<void> {
848848
const pattern = isLinux ? appName : 'gogdl'
849849
killPattern(pattern)
850850

851-
if (stopWine && !isNative(appName) && isLinux) {
851+
if (stopWine && !isNative(appName)) {
852852
const gameSettings = await getSettings(appName)
853853
await shutdownWine(gameSettings)
854854
}

src/backend/storeManagers/legendary/games.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -973,7 +973,7 @@ export async function stop(appName: string, stopWine = true) {
973973
const pattern = process.platform === 'linux' ? appName : 'legendary'
974974
killPattern(pattern)
975975

976-
if (stopWine && isNative(appName)) {
976+
if (stopWine && !isNative(appName)) {
977977
const gameSettings = await getSettings(appName)
978978
await shutdownWine(gameSettings)
979979
}

src/backend/storeManagers/sideload/games.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
import { libraryStore } from './electronStores'
1010
import { GameConfig } from '../../game_config'
1111
import { isWindows, isMac, isLinux, icon } from '../../constants'
12-
import { killPattern } from '../../utils'
12+
import { killPattern, shutdownWine } from '../../utils'
1313
import { logInfo, LogPrefix, logWarning } from '../../logger/logger'
1414
import path, { dirname, resolve } from 'path'
1515
import { existsSync, rmSync } from 'graceful-fs'
@@ -129,6 +129,11 @@ export async function stop(appName: string): Promise<void> {
129129
const split = executable.split('/')
130130
const exe = split[split.length - 1]
131131
killPattern(exe)
132+
133+
if (!isNative(appName)) {
134+
const gameSettings = await getSettings(appName)
135+
shutdownWine(gameSettings)
136+
}
132137
}
133138
}
134139

0 commit comments

Comments
 (0)