[MM-34067] Explicitly destroy web contents in non-permanent BrowserViews (#1519)
* [MM-34067] Explicitly destroy web contents in non-permanent BrowserViews * Comment to remove this later
This commit is contained in:
@@ -171,6 +171,11 @@ export class MattermostView extends EventEmitter {
|
|||||||
if (this.window) {
|
if (this.window) {
|
||||||
this.window.removeBrowserView(this.view);
|
this.window.removeBrowserView(this.view);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// workaround to eliminate zombie processes
|
||||||
|
// https://github.com/mattermost/desktop/pull/1519
|
||||||
|
this.view.webContents.destroy();
|
||||||
|
|
||||||
this.window = null;
|
this.window = null;
|
||||||
this.server = null;
|
this.server = null;
|
||||||
this.isVisible = false;
|
this.isVisible = false;
|
||||||
|
@@ -70,8 +70,12 @@ export class ModalView {
|
|||||||
if (this.view.webContents.isDevToolsOpened()) {
|
if (this.view.webContents.isDevToolsOpened()) {
|
||||||
this.view.webContents.closeDevTools();
|
this.view.webContents.closeDevTools();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.windowAttached.removeBrowserView(this.view);
|
this.windowAttached.removeBrowserView(this.view);
|
||||||
|
|
||||||
|
// workaround to eliminate zombie processes
|
||||||
|
// https://github.com/mattermost/desktop/pull/1519
|
||||||
|
this.view.webContents.destroy();
|
||||||
|
|
||||||
this.windowAttached = null;
|
this.windowAttached = null;
|
||||||
this.status = ACTIVE;
|
this.status = ACTIVE;
|
||||||
}
|
}
|
||||||
|
@@ -203,6 +203,10 @@ export class ViewManager {
|
|||||||
const hideView = () => {
|
const hideView = () => {
|
||||||
this.urlViewCancel = null;
|
this.urlViewCancel = null;
|
||||||
currentWindow.removeBrowserView(urlView);
|
currentWindow.removeBrowserView(urlView);
|
||||||
|
|
||||||
|
// workaround to eliminate zombie processes
|
||||||
|
// https://github.com/mattermost/desktop/pull/1519
|
||||||
|
urlView.webContents.destroy();
|
||||||
};
|
};
|
||||||
|
|
||||||
const timeout = setTimeout(hideView,
|
const timeout = setTimeout(hideView,
|
||||||
|
Reference in New Issue
Block a user