Bug 777787 - Fix issues discovered in msgDBCacheManager.js. r=IanN,RattyAway
authorEdmund Wong <ewong@pw-wspx.org>
Thu, 02 Aug 2012 11:15:29 +0800
changeset 13184 7d005aa5bd49e3d59ed7640cddfe998110eb37d1
parent 13183 9f49374d967839afba1d460def969ebc0571ba1d
child 13185 7155880be5bb07b933ae6d451a097dc47635c371
push idunknown
push userunknown
push dateunknown
reviewersIanN, RattyAway
bugs777787
Bug 777787 - Fix issues discovered in msgDBCacheManager.js. r=IanN,RattyAway
mailnews/base/util/msgDBCacheManager.js
--- a/mailnews/base/util/msgDBCacheManager.js
+++ b/mailnews/base/util/msgDBCacheManager.js
@@ -9,19 +9,16 @@
 /* :::::::: Constants and Helpers ::::::::::::::: */
 
 const EXPORTED_SYMBOLS = ["msgDBCacheManager"];
 
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 const Cu = Components.utils;
 
-Cu.import("resource:///modules/IOUtils.js");
-Cu.import("resource:///modules/iteratorUtils.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
 
 /**
  */
 const DBCACHE_INTERVAL_DEFAULT_MS = 60000; // 1 minute
 
 /* :::::::: The Module ::::::::::::::: */
 
@@ -61,16 +58,17 @@ var msgDBCacheManager =
 /* ........ Observer Notification Handler ................*/
 
   observe: function dbCache_observe(aSubject, aTopic, aData) {
     switch (aTopic) {
     // This is observed before any windows start unloading if something other
     // than the last 3pane window closing requested the application be
     // shutdown. For example, when the user quits via the file menu.
     case "quit-application-granted":
+      Services.obs.removeObserver(this, "quit-application-granted");
       this.stopPeriodicCheck();
       break;
     }
   },
 
 /* ........ Public API ................*/
 
   /**