mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1051995 - Removed 'mozdocommand' event listener when browser destroyed. r=fabrice
This commit is contained in:
parent
927916753d
commit
c47690098b
@ -168,11 +168,14 @@ function BrowserElementParent(frameLoader, hasRemoteFrame, isPendingFrame) {
|
||||
/* wantsUntrusted = */ false);
|
||||
}
|
||||
|
||||
this._doCommandHandlerBinder = this._doCommandHandler.bind(this);
|
||||
this._frameElement.addEventListener('mozdocommand',
|
||||
this._doCommandHandler.bind(this),
|
||||
this._doCommandHandlerBinder,
|
||||
/* useCapture = */ false,
|
||||
/* wantsUntrusted = */ false);
|
||||
|
||||
Services.obs.addObserver(this, 'ipc:browser-destroyed', /* ownsWeak = */ true);
|
||||
|
||||
this._window._browserElementParents.set(this, null);
|
||||
|
||||
// Insert ourself into the prompt service.
|
||||
@ -919,6 +922,13 @@ BrowserElementParent.prototype = {
|
||||
}
|
||||
Services.obs.removeObserver(this, 'remote-browser-frame-shown');
|
||||
}
|
||||
case 'ipc:browser-destroyed':
|
||||
if (this._isAlive() && subject == this._frameLoader) {
|
||||
Services.obs.removeObserver(this, 'ipc:browser-destroyed');
|
||||
this._frameElement.removeEventListener('mozdocommand',
|
||||
this._doCommandHandlerBinder)
|
||||
}
|
||||
break;
|
||||
default:
|
||||
debug('Unknown topic: ' + topic);
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user