Bug 1058099 - Cancel CacheStorageService::mPurgeTimer if it's still set during shutdown r=mayhemer
authorSteve Workman <sworkman@mozilla.com>
Tue, 02 Sep 2014 13:33:32 -0700
changeset 203298 9ed4c053e6646725cb603a25ea7ab8fffe165821
parent 203297 f1e58e5b8cdc8c371b166a5b9173a97d7f836bdd
child 203299 c7a9e81772026db3aefc3093412c7375cefa0b12
push id27425
push userryanvm@gmail.com
push dateWed, 03 Sep 2014 20:38:59 +0000
treeherdermozilla-central@acbdce59da2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmayhemer
bugs1058099
milestone35.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1058099 - Cancel CacheStorageService::mPurgeTimer if it's still set during shutdown r=mayhemer
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