Bug 1369009 - Intermittent layout/style/test/browser_newtab_share_rule_processors.js. r=honzab
authorMichal Novotny <michal.novotny@gmail.com>
Fri, 07 Jul 2017 04:58:00 -0400
changeset 607779 734640228fbc00212f96ea1a362247887d739b73
parent 607778 6506888c5f7b25b2a690117fb60fe79a90d274e6
child 607780 5b77f711e2b4990067452d5dc04f613c42248b6d
push id68110
push userbmo:nchen@mozilla.com
push dateWed, 12 Jul 2017 21:26:51 +0000
reviewershonzab
bugs1369009
milestone56.0a1
Bug 1369009 - Intermittent layout/style/test/browser_newtab_share_rule_processors.js. r=honzab
netwerk/cache2/CacheFileIOManager.cpp
netwerk/cache2/CacheIndex.cpp
--- a/netwerk/cache2/CacheFileIOManager.cpp
+++ b/netwerk/cache2/CacheFileIOManager.cpp
@@ -1293,16 +1293,21 @@ CacheFileIOManager::ShutdownInternal()
 {
   LOG(("CacheFileIOManager::ShutdownInternal() [this=%p]", this));
 
   MOZ_ASSERT(mIOThread->IsCurrentThread());
 
   // No new handles can be created after this flag is set
   mShuttingDown = true;
 
+  if (mTrashTimer) {
+    mTrashTimer->Cancel();
+    mTrashTimer = nullptr;
+  }
+
   // close all handles and delete all associated files
   nsTArray<RefPtr<CacheFileHandle> > handles;
   mHandles.GetAllHandles(&handles);
   handles.AppendElements(mSpecialHandles);
 
   for (uint32_t i=0 ; i<handles.Length() ; i++) {
     CacheFileHandle *h = handles[i];
     h->mClosed = true;
--- a/netwerk/cache2/CacheIndex.cpp
+++ b/netwerk/cache2/CacheIndex.cpp
@@ -393,16 +393,17 @@ CacheIndex::PreShutdownInternal()
 
   LOG(("CacheIndex::PreShutdownInternal() - [state=%d, indexOnDiskIsValid=%d, "
        "dontMarkIndexClean=%d]", mState, mIndexOnDiskIsValid,
        mDontMarkIndexClean));
 
   MOZ_ASSERT(mShuttingDown);
 
   if (mUpdateTimer) {
+    mUpdateTimer->Cancel();
     mUpdateTimer = nullptr;
   }
 
   switch (mState) {
     case WRITING:
       FinishWrite(false);
       break;
     case READY: