Skip to content

Commit b027ca7

Browse files
committed
Exit net core backend on electron quit
This change explicitly cleans up the .net core http process when the hosting electron application quits. On macos, the child process was sometimes left running depending on how the application was exited. GH-346
1 parent 0573e92 commit b027ca7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

ElectronNET.Host/main.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ app.on('ready', () => {
6262

6363
});
6464

65+
app.on('quit', async (event, exitCode) => {
66+
await server.close();
67+
apiProcess.kill();
68+
});
69+
6570
function isSplashScreenEnabled() {
6671
if (manifestJsonFile.hasOwnProperty('splashscreen')) {
6772
if (manifestJsonFile.splashscreen.hasOwnProperty('imageFile')) {

0 commit comments

Comments
 (0)