Skip to content

TagSpaces is an offline, open source, document manager with tagging support

fixing crash on quit by mac os #816

Ilian Sapundshiev89129999b0bb
diff --git a/app/main.dev.js b/app/main.dev.js
index 56d2af7a5..0b763e821 100644
--- a/app/main.dev.js
+++ b/app/main.dev.js
@@ -85,9 +85,10 @@ app.commandLine.appendSwitch('autoplay-policy', 'no-user-gesture-required'); //
app.on('window-all-closed', () => {
// Respect the OSX convention of having the application in memory even
// after all windows have been closed
- // if (process.platform !== 'darwin') {
- app.quit();
- // }
+ if (process.platform !== 'darwin') {
+ globalShortcut.unregisterAll();
+ app.quit();
+ }
});
app.on('ready', async () => {
@@ -156,7 +157,7 @@ app.on('ready', async () => {
global.splashWorkerWindow.close();
global.splashWorkerWindow = null;
} catch (err) {
- console.warn('Error closing the splash window. ' + err);
+ // console.warn('Error closing the splash window. ' + err);
}
});
diff --git a/app/services/electron-io.js b/app/services/electron-io.js
index fa3bc0d71..b1690ba17 100644
--- a/app/services/electron-io.js
+++ b/app/services/electron-io.js
@@ -124,7 +124,8 @@ export default class ElectronIO {
};
quitApp = (): void => {
- this.win.destroy();
+ // this.win.destroy();
+ this.ipcRenderer.send('quit-application', 'Bye, bye...');
};
// Experimental functionality
diff --git a/app/services/electron-menus.js b/app/services/electron-menus.js
index 1ba081597..1ad0b3e1c 100644
--- a/app/services/electron-menus.js
+++ b/app/services/electron-menus.js
@@ -130,9 +130,7 @@ export default function buildDesktopMenu(mainPageProps: Object) {
{
label: i18n.t('core:exitApp'),
accelerator: 'CmdOrCtrl+Q',
- click: () => {
- ipcRenderer.send('quit-application', 'Bye, bye...');
- }
+ click: PlatformIO.quitApp
}
]
},