зеркало из https://github.com/mozilla/gecko-dev.git
Bug 875432 - Loader.jsm references gDevTools. r=jwalker
This commit is contained in:
Родитель
c4af42a953
Коммит
5b2c790957
|
@ -28,9 +28,11 @@ this.DevTools = function DevTools() {
|
|||
|
||||
// destroy() is an observer's handler so we need to preserve context.
|
||||
this.destroy = this.destroy.bind(this);
|
||||
this._teardown = this._teardown.bind(this);
|
||||
|
||||
EventEmitter.decorate(this);
|
||||
|
||||
Services.obs.addObserver(this._teardown, "devtools-unloaded", false);
|
||||
Services.obs.addObserver(this.destroy, "quit-application", false);
|
||||
}
|
||||
|
||||
|
@ -273,6 +275,7 @@ DevTools.prototype = {
|
|||
*/
|
||||
destroy: function() {
|
||||
Services.obs.removeObserver(this.destroy, "quit-application");
|
||||
Services.obs.removeObserver(this._teardown, "devtools-unloaded");
|
||||
|
||||
for (let [key, tool] of this.getToolDefinitionMap()) {
|
||||
this.unregisterTool(key, true);
|
||||
|
|
|
@ -194,16 +194,17 @@ this.devtools = {
|
|||
}
|
||||
|
||||
if (this._provider) {
|
||||
var events = this.require("sdk/system/events");
|
||||
events.emit("devtools-unloaded", {});
|
||||
delete this.require;
|
||||
this._provider.unload("newprovider");
|
||||
gDevTools._teardown();
|
||||
}
|
||||
this._provider = provider;
|
||||
this._provider.load();
|
||||
this.require = loader.Require(this._provider.loader, { id: "devtools" });
|
||||
|
||||
if (this._mainid) {
|
||||
this.main(mainid);
|
||||
this.main(this._mainid);
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -224,10 +225,10 @@ this.devtools = {
|
|||
reload: function() {
|
||||
var events = devtools.require("sdk/system/events");
|
||||
events.emit("startupcache-invalidate", {});
|
||||
events.emit("devtools-unloaded", {});
|
||||
|
||||
this._provider.unload("reload");
|
||||
delete this._provider;
|
||||
gDevTools._teardown();
|
||||
this._chooseProvider();
|
||||
},
|
||||
};
|
||||
|
|
Загрузка…
Ссылка в новой задаче