Bug 966970 - Fix for intermittent browser_webconsole_bug_632275_getters_document_width.js | Test timed out; r=pbrosset

This commit is contained in:
Mihai Sucan 2014-02-05 14:22:37 +02:00
parent 5d86688f5e
commit c5998ade92

View File

@ -1060,17 +1060,25 @@ Toolbox.prototype = {
let deferred = promise.defer();
if (this._inspector) {
this._selection.destroy();
this._selection = null;
this._walker.release().then(
// Selection is not always available.
if (this._selection) {
this._selection.destroy();
this._selection = null;
}
let walker = this._walker ? this._walker.release() : promise.resolve(null);
walker.then(
() => {
this._inspector.destroy();
this._highlighter.destroy();
if (this._highlighter) {
this._highlighter.destroy();
}
},
(e) => {
console.error("Walker.release() failed: " + e);
this._inspector.destroy();
return this._highlighter.destroy();
return this._highlighter ? this._highlighter.destroy() : promise.resolve(null);
}
).then(() => {
this._inspector = null;