mirror of
https://github.com/finos/SymphonyElectron.git
synced 2024-11-27 11:20:45 -06:00
ELECTRON-455: fix memory leak on closing pop ups (#359)
This commit is contained in:
parent
1739a25f22
commit
1e924274b3
@ -395,21 +395,6 @@ function doCreateMainWindow(initialUrl, initialBounds, isCustomTitleBar) {
|
|||||||
browserWin.winName = frameName;
|
browserWin.winName = frameName;
|
||||||
browserWin.setAlwaysOnTop(alwaysOnTop);
|
browserWin.setAlwaysOnTop(alwaysOnTop);
|
||||||
|
|
||||||
let handleChildWindowClosed = () => {
|
|
||||||
removeWindowKey(newWinKey);
|
|
||||||
browserWin.removeListener('move', throttledBoundsChange);
|
|
||||||
browserWin.removeListener('resize', throttledBoundsChange);
|
|
||||||
};
|
|
||||||
|
|
||||||
browserWin.once('closed', () => {
|
|
||||||
handleChildWindowClosed();
|
|
||||||
});
|
|
||||||
|
|
||||||
browserWin.on('close', () => {
|
|
||||||
browserWin.webContents.removeListener('new-window', handleNewWindow);
|
|
||||||
browserWin.webContents.removeListener('crashed', handleChildWindowCrashEvent);
|
|
||||||
});
|
|
||||||
|
|
||||||
let handleChildWindowCrashEvent = (e) => {
|
let handleChildWindowCrashEvent = (e) => {
|
||||||
const options = {
|
const options = {
|
||||||
type: 'error',
|
type: 'error',
|
||||||
@ -450,6 +435,21 @@ function doCreateMainWindow(initialUrl, initialBounds, isCustomTitleBar) {
|
|||||||
browserWin.on('move', throttledBoundsChange);
|
browserWin.on('move', throttledBoundsChange);
|
||||||
browserWin.on('resize', throttledBoundsChange);
|
browserWin.on('resize', throttledBoundsChange);
|
||||||
|
|
||||||
|
let handleChildWindowClosed = () => {
|
||||||
|
removeWindowKey(newWinKey);
|
||||||
|
browserWin.removeListener('move', throttledBoundsChange);
|
||||||
|
browserWin.removeListener('resize', throttledBoundsChange);
|
||||||
|
};
|
||||||
|
|
||||||
|
browserWin.on('close', () => {
|
||||||
|
browserWin.webContents.removeListener('new-window', handleNewWindow);
|
||||||
|
browserWin.webContents.removeListener('crashed', handleChildWindowCrashEvent);
|
||||||
|
});
|
||||||
|
|
||||||
|
browserWin.once('closed', () => {
|
||||||
|
handleChildWindowClosed();
|
||||||
|
});
|
||||||
|
|
||||||
handlePermissionRequests(browserWin.webContents);
|
handlePermissionRequests(browserWin.webContents);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user