Recently I have noticed that when exiting my electron app, I sometimes observe that it's processes are still running, when viewing my system monitor (testing on Linux Mint 21.3 mostly). I end up having to manually kill these processes to get another instance running properly.
Additionally I often debug using vscode, and after closing the main application window, I see the debugger stack trace remains (see screenshot).
If I press pause in the debugger i would expect it to show what stack frame it is busy executing to get an idea of why it doesn't exit, but pressing pause doesn't ever seem to do anything at this point.
Only pressing the debugger stop button actually ends the session. I could be mistaken, but I don't believe that was always the case, or that is how electron debugging is supposed to function?
I have tried adding the following to my main source file, but it didn't seem to make a difference:
app.on('window-all-closed', function() {
app.quit()
})
Any ideas what is going on or how I can ensure that my app closes successfully?