Bug 375805 - ExtensionManager.prototype._shutdown shouldn' t call gOS.removeObserver(this, 'profile-after-change') unless ExtensionManager.prototype.observe(subject, 'app-startup', data) has been called. r=sspitzer

This commit is contained in:
rob_strong@exchangecode.com 2007-08-30 17:43:24 -07:00
parent 46d7c2aecc
commit aa94dc5ec9
2 changed files with 13 additions and 5 deletions

View File

@ -83,7 +83,8 @@ var gLoggingEnabled = null;
function LOG(string) {
if (gLoggingEnabled) {
dump("*** " + string + "\n");
gConsole.logStringMessage(string);
if (gConsole)
gConsole.logStringMessage(string);
}
}
@ -223,6 +224,7 @@ Blocklist.prototype = {
case "app-startup":
gOS.addObserver(this, "plugins-list-updated", false);
gOS.addObserver(this, "profile-after-change", false);
gOS.addObserver(this, "quit-application", false);
break;
case "profile-after-change":
gLoggingEnabled = getPref("getBoolPref", PREF_EM_LOGGING_ENABLED, false);
@ -234,10 +236,12 @@ Blocklist.prototype = {
case "plugins-list-updated":
this._checkPluginsList();
break;
case "quit-application":
gOS.removeObserver(this, "plugins-list-updated");
gOS.removeObserver(this, "profile-after-change");
gOS.removeObserver(this, "quit-application");
case "xpcom-shutdown":
gOS.removeObserver(this, "xpcom-shutdown");
gOS.removeObserver(this, "profile-after-change");
gOS.removeObserver(this, "plugins-list-updated");
gOS = null;
gPref = null;
gConsole = null;

View File

@ -533,7 +533,8 @@ function removeDirRecursive(dir) {
function LOG(string) {
if (gLoggingEnabled) {
dump("*** " + string + "\n");
gConsole.logStringMessage(string);
if (gConsole)
gConsole.logStringMessage(string);
}
}
@ -2409,6 +2410,7 @@ ExtensionManager.prototype = {
switch (topic) {
case "app-startup":
gOS.addObserver(this, "profile-after-change", false);
gOS.addObserver(this, "quit-application", false);
break;
case "profile-after-change":
this._profileSelected();
@ -2419,6 +2421,9 @@ ExtensionManager.prototype = {
case "offline-requested":
this._confirmCancelDownloadsOnOffline(subject);
break;
case "quit-application":
gOS.removeObserver(this, "profile-after-change");
gOS.removeObserver(this, "quit-application");
case "xpcom-shutdown":
this._shutdown();
break;
@ -2532,7 +2537,6 @@ ExtensionManager.prototype = {
*/
_shutdown: function() {
gOS.removeObserver(this, "xpcom-shutdown");
gOS.removeObserver(this, "profile-after-change");
// Release strongly held services.
gOS = null;