Bug 1268073 - Free loader created by BrowserToolboxProcess. r=jryans

This commit is contained in:
Alexandre Poirot 2016-06-28 08:39:37 -07:00
parent b62081ba39
commit 250e55dddb
2 changed files with 13 additions and 6 deletions

View File

@ -261,6 +261,9 @@ BrowserToolboxProcess.prototype = {
this._dbgProcess = null;
this._options = null;
if (this.loader) {
this.loader.destroy();
}
this.loader = null;
this._telemetry = null;
}

View File

@ -82,6 +82,15 @@ this.DevToolsLoader = function DevToolsLoader() {
};
DevToolsLoader.prototype = {
destroy: function (reason = "shutdown") {
Services.obs.removeObserver(this, "devtools-unload");
if (this._provider) {
this._provider.unload(reason);
delete this._provider;
}
},
get provider() {
if (!this._provider) {
this._loadProvider();
@ -177,12 +186,7 @@ DevToolsLoader.prototype = {
if (topic != "devtools-unload") {
return;
}
Services.obs.removeObserver(this, "devtools-unload");
if (this._provider) {
this._provider.unload(data);
delete this._provider;
}
this.destroy(data);
},
/**