bug 385086: followup patch to null more XPCOM components that could potentially cause leaks and also clear structures of observers to avoid cycles in the event the observers don't remove themselves

r=sayrer
This commit is contained in:
2007-06-21 11:52:35 -07:00
parent 3173b95a28
commit b2c45f53c1
3 changed files with 20 additions and 2 deletions

View File

@@ -81,7 +81,8 @@ ContentPrefService.prototype = {
_destroy: function ContentPrefService__destroy() {
this._observerSvc.removeObserver(this, "xpcom-shutdown");
// Delete various references to XPCOM components so we don't leak them.
// Delete references to XPCOM components to make sure we don't leak them
// (although we haven't observed leakage in tests).
this.__observerSvc = null;
this.__consoleSvc = null;
this._grouper = null;
@@ -101,6 +102,11 @@ ContentPrefService.prototype = {
this.__stmtSelectPrefs = null;
this.__stmtSelectGlobalPrefs = null;
this._dbConnection = null;
// Delete references to observers to avoid cycles with those that refer
// to us and don't remove themselves from the observer pool.
this._observers = {};
this._genericObservers = [];
},