rem: gDBView = null; 
add: if (gDBView) { gDBView.close(); gDBView = null; } 
context: function RerootFolder(uri, newFolder, viewType, viewFlags, sortType, sortOrder){  //dump("In reroot folder, sortType = " +  sortType + "\n");  // workaround for #39655  gFolderJustSwitched = true;  ClearThreadPaneSelection();  //Clear the new messages of the old folder  var oldFolder = msgWindow.openFolder;  if (oldFolder) {    if (oldFolder.hasNewMessages) {      oldFolder.clearNewMessages();    }  }  //Set the window's new open folder.  msgWindow.openFolder = newFolder;  SetViewFlags(viewFlags);  //the new folder being selected should have its biff state get cleared.  if(newFolder)  {    newFolder.biffState =          Components.interfaces.nsIMsgFolder.nsMsgBiffState_NoMail;  }  //Clear out the thread pane so that we can sort it with the new sort id without taking any time.  // folder.setAttribute('ref', "");   if (isNewsURI(uri))       SetNewsFolderColumns(true);   else       SetNewsFolderColumns(false);  // null this out, so we don't try sort.  gDBView = null;  // if this is the drafts, sent, or send later folder,  // we show "Recipient" instead of "Author"  SetSentFolderColumns(IsSpecialFolder(newFolder, MSG_FOLDER_FLAG_SENTMAIL | MSG_FOLDER_FLAG_DRAFTS | MSG_FOLDER_FLAG_QUEUE));  // now create the db view, which will sort it.  CreateDBView(newFolder, viewType, viewFlags, sortType, sortOrder);  // that should have initialized gDBView, now re-root the thread pane  var outlinerView = gDBView.QueryInterface(Components.interfaces.nsIOutlinerView);  if (outlinerView)  {    var outliner = GetThreadOutliner();    outliner.boxObject.QueryInterface(Components.interfaces.nsIOutlinerBoxObject).view = outlinerView;  }  SetUpToolbarButtons(uri);  UpdateStatusMessageCounts(newFolder);}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/505d6df3336597611d6bdd10cb6ade98c8e551bf/commandglue.js/buggy/mailnews/base/resources/content/commandglue.js