From b027ca7c6685695e72ee0cd9c4333a86119107d5 Mon Sep 17 00:00:00 2001 From: Dave Ferguson Date: Sun, 17 May 2020 21:49:21 -0400 Subject: [PATCH] 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 --- ElectronNET.Host/main.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ElectronNET.Host/main.js b/ElectronNET.Host/main.js index 60b4037..2db6bb1 100644 --- a/ElectronNET.Host/main.js +++ b/ElectronNET.Host/main.js @@ -62,6 +62,11 @@ app.on('ready', () => { }); +app.on('quit', async (event, exitCode) => { + await server.close(); + apiProcess.kill(); +}); + function isSplashScreenEnabled() { if (manifestJsonFile.hasOwnProperty('splashscreen')) { if (manifestJsonFile.splashscreen.hasOwnProperty('imageFile')) {