[MM=34088] remove listeners before destroy (#1516)

This commit is contained in:
Guillermo Vayá
2021-03-22 19:37:17 +01:00
committed by GitHub
parent e76e0dc0a1
commit 5ed84270c8

View File

@@ -14,6 +14,8 @@ import {getWindowBoundaries, getLocalPreload} from '../utils';
import * as WindowManager from '../windows/windowManager'; import * as WindowManager from '../windows/windowManager';
import * as appState from '../appState'; import * as appState from '../appState';
import {removeWebContentsListeners} from './webContentEvents';
// copying what webview sends // copying what webview sends
// TODO: review // TODO: review
const userAgent = `Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.146 Electron/6.1.7 Safari/537.36 Mattermost/${app.getVersion()}`; const userAgent = `Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.146 Electron/6.1.7 Safari/537.36 Mattermost/${app.getVersion()}`;
@@ -165,6 +167,7 @@ export class MattermostView extends EventEmitter {
if (this.retryLoad) { if (this.retryLoad) {
clearTimeout(this.retryLoad); clearTimeout(this.retryLoad);
} }
removeWebContentsListeners(this.view.webContents.id);
if (this.window) { if (this.window) {
this.window.removeBrowserView(this.view); this.window.removeBrowserView(this.view);
} }