Bug 614513 - Crash in nsCacheService::DeactivateEntry during Linux Talos. r=bzbarsky@mit.edu, a=blocker
authorMichal Novotny <michal.novotny@gmail.com>
Thu, 27 Jan 2011 17:02:44 +0200
changeset 61410 4215d5d9bc906b8a6f4438a2f9e73b6029bc8136
parent 61409 5e0bba79c052f89caa54df38210fa0a7a1028bdf
child 61411 c165b31279753b01f84089924ab585fa4f43d1c2
push idunknown
push userunknown
push dateunknown
reviewersbzbarsky, blocker
bugs614513
milestone2.0b11pre
Bug 614513 - Crash in nsCacheService::DeactivateEntry during Linux Talos. r=bzbarsky@mit.edu, a=blocker
netwerk/cache/nsCacheEntry.cpp
--- a/netwerk/cache/nsCacheEntry.cpp
+++ b/netwerk/cache/nsCacheEntry.cpp
@@ -245,18 +245,19 @@ nsCacheEntry::RemoveRequest(nsCacheReque
              (PR_CLIST_IS_EMPTY(&mDescriptorQ)));
 }
 
 
 PRBool
 nsCacheEntry::RemoveDescriptor(nsCacheEntryDescriptor * descriptor)
 {
     NS_ASSERTION(descriptor->CacheEntry() == this, "### Wrong cache entry!!");
+    descriptor->CloseOutput();
+    descriptor->ClearCacheEntry();
     PR_REMOVE_AND_INIT_LINK(descriptor);
-    descriptor->ClearCacheEntry();
 
     if (!PR_CLIST_IS_EMPTY(&mDescriptorQ))
         return PR_TRUE;  // stay active if we still have open descriptors
 
     if (PR_CLIST_IS_EMPTY(&mRequestQ))
         return PR_FALSE; // no descriptors or requests, we can deactivate
 
     return PR_TRUE;     // find next best request to give a descriptor to