mirror of
https://github.com/mullvad/mullvadvpn-app.git
synced 2026-03-13 10:22:35 +08:00
Fix bug on Linux where hot reload in src/main file froze window
When a file in src/main is changed the vite-plugin-electron will kill the electron process and restart it. However, on Linux it seems like the electron window process freezes if we do that. Killing the main electron process seems to kill all its children, on Linux. We will manually kill the process children before the parent process on macOS as the current implementation seems to work well on that platform.
This commit is contained in:
@@ -41,9 +41,11 @@ function pidTree(tree: PidTree) {
|
||||
}
|
||||
|
||||
function killTree(tree: PidTree) {
|
||||
if (tree.children) {
|
||||
for (const child of tree.children) {
|
||||
killTree(child);
|
||||
if (process.platform === 'darwin') {
|
||||
if (tree.children) {
|
||||
for (const child of tree.children) {
|
||||
killTree(child);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user