[Bug 671517] Port relevant bits of Bug 588506 [nsSessionStartup is keeping restored session in memory]. r=Neil. a=Neil.
authorMisak Khachatryan <misak.bugzilla@gmail.com>
Fri, 15 Jul 2011 12:01:38 +0500
changeset 8295 d163c3c13f846a6daee06f6d339a714e36f258b8
parent 8294 a0b96b0f6a6f19698aa8bc1beba44a47de7d170b
child 8296 e4037890a90da4411598d0a29876432141855902
push idunknown
push userunknown
push dateunknown
reviewersNeil, Neil
bugs671517, 588506
[Bug 671517] Port relevant bits of Bug 588506 [nsSessionStartup is keeping restored session in memory]. r=Neil. a=Neil.
suite/common/src/nsSessionStartup.js
--- a/suite/common/src/nsSessionStartup.js
+++ b/suite/common/src/nsSessionStartup.js
@@ -158,32 +158,22 @@ SessionStartup.prototype = {
       this.init();
       break;
     case "quit-application":
       // no reason for initializing at this point (cf. bug 409115)
       Services.obs.removeObserver(this, "final-ui-startup");
       Services.obs.removeObserver(this, "quit-application");
       break;
     case "sessionstore-windows-restored":
-      Services.obs.removeObserver(this, "sessionstore-windows-restored");
-      // reset session type after restore
-      this._sessionType = Components.interfaces.nsISessionStartup.NO_SESSION;
       // no need in repeating this, since session type won't change
       Services.obs.removeObserver(this, "sessionstore-windows-restored");
-      // We only want to start listening for the purge notification after we've
-      // sessionstore has finished its initial startup. That way we won't observe
-      // the purge notification & clear the old session before sessionstore loads
-      // it (in the case of a crash).
-      Services.obs.addObserver(this, "browser:purge-session-history", true);
-      break;
-    case "browser:purge-session-history":
-      // reset all state on sanitization
+      // free _iniString after nsSessionStore is done with it
       this._iniString = null;
-      // no need in repeating this, since startup state won't change
-      Services.obs.removeObserver(this, "browser:purge-session-history");
+      // reset session type after restore
+      this._sessionType = Components.interfaces.nsISessionStartup.NO_SESSION;
       break;
     }
   },
 
 /* ........ Public API ................*/
 
   /**
    * Get the session state as a string