fix crash on exit (#31)

This commit is contained in:
Lynn 2017-03-07 15:26:24 -08:00 committed by GitHub
parent 38f92b8849
commit 766933ebf1

View File

@ -96,7 +96,7 @@ function createMainWindow(url) {
removeWindowKey(key);
if (mainWindow) {
mainWindow.removeAllListeners();
if (mainWindow.webContents) {
if (!mainWindow.isDestroyed() && mainWindow.webContents) {
mainWindow.webContents.removeAllListeners();
}
mainWindow = null;
@ -159,7 +159,7 @@ function createChildWindow(url, title, width, height) {
removeWindowKey(winKey);
if (childWindow) {
childWindow.removeAllListeners();
if (childWindow.webContents) {
if (!childWindow.isDestroyed() && childWindow.webContents) {
childWindow.webContents.removeAllListeners();
}
}