Bug 1058099 - Cancel CacheStorageService::mPurgeTimer if it's still set during shutdown. r=mayhemer, a=lmandel
authorSteve Workman <sworkman@mozilla.com>
Tue, 02 Sep 2014 13:33:32 -0700
changeset 216672 ede2300e8733
parent 216671 8b409f2dfcb1
child 216673 7984a6ceffb8
push id3870
push userryanvm@gmail.com
push date2014-09-08 17:45 +0000
treeherdermozilla-beta@880228a5208a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmayhemer, lmandel
bugs1058099
milestone33.0
Bug 1058099 - Cancel CacheStorageService::mPurgeTimer if it's still set during shutdown. r=mayhemer, a=lmandel
netwerk/cache2/CacheStorageService.cpp
--- a/netwerk/cache2/CacheStorageService.cpp
+++ b/netwerk/cache2/CacheStorageService.cpp
@@ -150,16 +150,21 @@ void CacheStorageService::Shutdown()
 
   LOG(("CacheStorageService::Shutdown - done"));
 }
 
 void CacheStorageService::ShutdownBackground()
 {
   MOZ_ASSERT(IsOnManagementThread());
 
+  // Cancel purge timer to avoid leaking.
+  if (mPurgeTimer) {
+    mPurgeTimer->Cancel();
+  }
+
   Pool(false).mFrecencyArray.Clear();
   Pool(false).mExpirationArray.Clear();
   Pool(true).mFrecencyArray.Clear();
   Pool(true).mExpirationArray.Clear();
 }
 
 // Internal management methods