diff options
| author | Tobias Järvelöv <tobias.jarvelov@mullvad.net> | 2025-04-16 16:22:12 +0200 |
|---|---|---|
| committer | Sebastian Holmin <sebastian.holmin@mullvad.net> | 2025-05-28 13:25:31 +0200 |
| commit | 1c1221e521b352dfcc1fe38bb3201bec817c66fa (patch) | |
| tree | 7e41fc0c763fc97a7cf8113ec19f7137ea36f0cf | |
| parent | e6f78b295492de2da9218478bbfbbadd400c2c89 (diff) | |
| download | mullvadvpn-1c1221e521b352dfcc1fe38bb3201bec817c66fa.tar.xz mullvadvpn-1c1221e521b352dfcc1fe38bb3201bec817c66fa.zip | |
Remove listener on child process when exit or error is emitted
| -rw-r--r-- | desktop/packages/mullvad-vpn/src/main/app-upgrade.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/desktop/packages/mullvad-vpn/src/main/app-upgrade.ts b/desktop/packages/mullvad-vpn/src/main/app-upgrade.ts index f17495cc6b..d29d3e3a22 100644 --- a/desktop/packages/mullvad-vpn/src/main/app-upgrade.ts +++ b/desktop/packages/mullvad-vpn/src/main/app-upgrade.ts @@ -96,7 +96,7 @@ export default class AppUpgrade { private startInstaller(verifiedInstallerPath: string) { const child = this.spawnChild(verifiedInstallerPath); - child.on('error', (error) => { + child.once('error', (error) => { log.error(`An error occurred with the installer: ${error.message}`); IpcMainEventChannel.app.notifyUpgradeError?.('INSTALLER_FAILED'); IpcMainEventChannel.app.notifyUpgradeEvent?.({ @@ -104,7 +104,7 @@ export default class AppUpgrade { }); }); - child.on('exit', (code) => { + child.once('exit', (code) => { if (code !== 0) { log.error(`The installer exited unexpectedly with exit code: ${code}`); IpcMainEventChannel.app.notifyUpgradeError?.('INSTALLER_FAILED'); |
