electron-135: fixes as per PR comments to avoid leakages

This commit is contained in:
Vishwas Shashidhar 2017-10-06 23:44:16 +05:30
parent 9dfbdaa1bb
commit a291846001

View File

@ -347,10 +347,10 @@ function doCreateMainWindow(initialUrl, initialBounds) {
electron.dialog.showMessageBox(options, function (index) {
if (index === 0) {
mainWindow.reload();
browserWin.reload();
}
else {
mainWindow.close();
browserWin.close();
}
});
});
@ -363,6 +363,12 @@ function doCreateMainWindow(initialUrl, initialBounds) {
openUrlInDefaultBrowser(childWinUrl);
});
// Clear up the browser window once the window is closed
// to avoid leakage
browserWin.on('closed', () => {
browserWin = null;
});
addWindowKey(newWinKey, browserWin);
// Method that sends bound changes as soon