Bug 741255 - ASSERTION: Oops! You're asking for a weak reference to an object that doesn't support that. during shutdown, with telemetry on stack; r=froydnj

This commit is contained in:
Andres Hernandez [:andreshm] 2012-05-07 14:02:02 -06:00
Родитель 3800f25756
Коммит 204353eb0e
1 изменённых файлов: 5 добавлений и 3 удалений

Просмотреть файл

@ -173,6 +173,7 @@ TelemetryPing.prototype = {
_startupHistogramRegex: /SQLITE|HTTP|SPDY|CACHE|DNS/,
_slowSQLStartup: {},
_prevSession: null,
_hasWindowRestoredObserver : false,
/**
* When reflecting a histogram into JS, Telemetry hands us an object
@ -626,6 +627,7 @@ TelemetryPing.prototype = {
Services.obs.addObserver(this, "profile-before-change", false);
Services.obs.addObserver(this, "sessionstore-windows-restored", false);
Services.obs.addObserver(this, "quit-application-granted", false);
this._hasWindowRestoredObserver = true;
// Delay full telemetry initialization to give the browser time to
// run various late initializers. Otherwise our gathered memory
@ -655,10 +657,9 @@ TelemetryPing.prototype = {
*/
uninstall: function uninstall() {
this.detachObservers()
try {
if (this._hasWindowRestoredObserver) {
Services.obs.removeObserver(this, "sessionstore-windows-restored");
} catch (e) {
// Already observed this event.
this._hasWindowRestoredObserver = false;
}
Services.obs.removeObserver(this, "profile-before-change");
Services.obs.removeObserver(this, "private-browsing");
@ -700,6 +701,7 @@ TelemetryPing.prototype = {
break;
case "sessionstore-windows-restored":
Services.obs.removeObserver(this, "sessionstore-windows-restored");
this._hasWindowRestoredObserver = false;
// fall through
case "test-gather-startup":
this.gatherStartupInformation();