Bug 415484 ? Form data isn't saved at shutdown (for zeniko, r=dietrich)
authordietrich@mozilla.com
Mon, 04 Feb 2008 10:04:48 -0800
changeset 11207 871a28cdd3d32dc6baf29760ebb22990a48e8504
parent 11206 264371cea63972c64329c43338ef7004674d3122
child 11208 ebe3dca2d5ae4d39c122cf67121faf7710fefada
push idunknown
push userunknown
push dateunknown
reviewersdietrich
bugs415484
milestone1.9b3pre
Bug 415484 ? Form data isn't saved at shutdown (for zeniko, r=dietrich)
browser/components/sessionstore/src/nsSessionStore.js
--- a/browser/components/sessionstore/src/nsSessionStore.js
+++ b/browser/components/sessionstore/src/nsSessionStore.js
@@ -478,36 +478,36 @@ SessionStoreService.prototype = {
     
     var tabbrowser = aWindow.getBrowser();
     var tabpanels = tabbrowser.mPanelContainer;
 
     tabbrowser.removeEventListener("TabOpen", this, true);
     tabbrowser.removeEventListener("TabClose", this, true);
     tabbrowser.removeEventListener("TabSelect", this, true);
     
-    for (var i = 0; i < tabpanels.childNodes.length; i++) {
-      this.onTabRemove(aWindow, tabpanels.childNodes[i], true);
-    }
-    
     if (this._loadState == STATE_RUNNING) { // window not closed during a regular shut-down 
       // update all window data for a last time
       this._collectWindowData(aWindow);
       
       // preserve this window's data (in case it was the last navigator:browser)
       this._lastWindowClosed = this._windows[aWindow.__SSi];
       this._lastWindowClosed.title = aWindow.content.document.title;
       this._updateCookies([this._lastWindowClosed]);
       
       // clear this window from the list
       delete this._windows[aWindow.__SSi];
       
       // save the state without this window to disk
       this.saveStateDelayed();
     }
     
+    for (var i = 0; i < tabpanels.childNodes.length; i++) {
+      this.onTabRemove(aWindow, tabpanels.childNodes[i], true);
+    }
+    
     // cache the window state until the window is completely gone
     aWindow.__SS_dyingCache = this._windows[aWindow.__SSi] || this._lastWindowClosed;
     
     delete aWindow.__SSi;
   },
 
   /**
    * set up listeners for a new tab