Bug 839280 - devtools increase CC graph size; r=jwalker

This commit is contained in:
Alexandre Poirot 2013-03-25 05:39:00 +02:00
parent fd4c99b633
commit 752ee1c08e
2 changed files with 9 additions and 1 deletions

View File

@ -714,6 +714,11 @@ Toolbox.prototype = {
outstanding.push(panel.destroy());
}
let container = this.doc.getElementById("toolbox-buttons");
while(container.firstChild) {
container.removeChild(container.firstChild);
}
outstanding.push(this._host.destroy());
// Targets need to be notified that the toolbox is being torn down, so that
@ -726,6 +731,9 @@ Toolbox.prototype = {
Promise.all(outstanding).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
this._host = null;
deferred.resolve();
}.bind(this));

View File

@ -607,7 +607,7 @@ let gDevToolsBrowser = {
// Destroy toolboxes for closed window
for (let [target, toolbox] of gDevTools._toolboxes) {
if (toolbox.frame.ownerDocument.defaultView == win) {
if (toolbox.frame && toolbox.frame.ownerDocument.defaultView == win) {
toolbox.destroy();
}
}