mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 915372 - Clean up inspector front and actor when reusing connection. r=paul
This commit is contained in:
parent
b3ab00bcdc
commit
bf3cee5aab
@ -428,6 +428,10 @@ TabTarget.prototype = {
|
||||
// Before taking any action, notify listeners that destruction is imminent.
|
||||
this.emit("close");
|
||||
|
||||
if (this._inspector) {
|
||||
this._inspector.destroy();
|
||||
}
|
||||
|
||||
// First of all, do cleanup tasks that pertain to both remoted and
|
||||
// non-remoted targets.
|
||||
this.off("thread-resumed", this._handleThreadState);
|
||||
|
@ -940,14 +940,18 @@ Toolbox.prototype = {
|
||||
|
||||
this._telemetry.destroy();
|
||||
|
||||
// Targets need to be notified that the toolbox is being torn down.
|
||||
if (this._target) {
|
||||
this._target.off("close", this.destroy);
|
||||
outstanding.push(this._target.destroy());
|
||||
}
|
||||
this._target = null;
|
||||
|
||||
promise.all(outstanding).then(function() {
|
||||
promise.all(outstanding).then(() => {
|
||||
// Targets need to be notified that the toolbox is being torn down.
|
||||
// This is done after other destruction tasks since it may tear down
|
||||
// fronts and the debugger transport which earlier destroy methods may
|
||||
// require to complete.
|
||||
if (this._target) {
|
||||
let target = this._target;
|
||||
this._target = null;
|
||||
target.off("close", this.destroy);
|
||||
return target.destroy();
|
||||
}
|
||||
}).then(function() {
|
||||
this.emit("destroyed");
|
||||
// Free _host after the call to destroyed in order to let a chance
|
||||
// to destroyed listeners to still query toolbox attributes
|
||||
|
@ -817,6 +817,7 @@ var WalkerActor = protocol.ActorClass({
|
||||
this._activePseudoClassLocks = null;
|
||||
this.progressListener.destroy();
|
||||
this.rootDoc = null;
|
||||
events.emit(this, "destroyed");
|
||||
protocol.Actor.prototype.destroy.call(this);
|
||||
},
|
||||
|
||||
@ -2208,6 +2209,10 @@ var InspectorActor = protocol.ActorClass({
|
||||
let tabActor = this.tabActor;
|
||||
window.removeEventListener("DOMContentLoaded", domReady, true);
|
||||
this.walker = WalkerActor(this.conn, tabActor, options);
|
||||
events.once(this.walker, "destroyed", () => {
|
||||
this._walkerPromise = null;
|
||||
this._pageStylePromise = null;
|
||||
});
|
||||
deferred.resolve(this.walker);
|
||||
};
|
||||
|
||||
|
@ -1047,7 +1047,10 @@ let Front = Class({
|
||||
|
||||
// Remaining packets must be responses.
|
||||
if (this._requests.length === 0) {
|
||||
throw Error("Unexpected packet from " + this.actorID + ", " + packet.type);
|
||||
let msg = "Unexpected packet from " + this.actorID + ", " + packet.type;
|
||||
let err = Error(msg);
|
||||
console.error(err);
|
||||
throw err;
|
||||
}
|
||||
|
||||
let deferred = this._requests.shift();
|
||||
|
Loading…
Reference in New Issue
Block a user