proper closing, metadata file locations moved
This commit is contained in:
@ -132,6 +132,9 @@ const createWindow = async () => {
|
||||
label: 'Quit',
|
||||
click: () => {
|
||||
pythonManager.stop();
|
||||
tray?.destroy();
|
||||
mainWindow.close();
|
||||
mainWindow.destroy();
|
||||
app.quit();
|
||||
},
|
||||
},
|
||||
@ -160,9 +163,9 @@ app.on('window-all-closed', () => {
|
||||
app
|
||||
.whenReady()
|
||||
.then(() => {
|
||||
if (app.isPackaged) {
|
||||
pythonManager.start();
|
||||
}
|
||||
// if (app.isPackaged) {
|
||||
pythonManager.start();
|
||||
// }
|
||||
createWindow();
|
||||
app.on('activate', () => {
|
||||
// On macOS it's common to re-create a window in the app when the
|
||||
|
||||
@ -63,6 +63,8 @@ export default class PythonSubprocessManager {
|
||||
|
||||
stop(): void {
|
||||
if (this.process) {
|
||||
// for some reason, process.kill() doens't work well with flask. todo: investigate further
|
||||
// spawn('taskkill', ['/pid', `${this.process.pid}`, '/f', '/t']);
|
||||
this.process.kill();
|
||||
this.process = null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user