Remove entry from CacheStorageEngineConnection lock map when unlocking a Cache
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Sep 2017 23:06:33 +0000 (23:06 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Sep 2017 23:06:33 +0000 (23:06 +0000)
https://bugs.webkit.org/show_bug.cgi?id=176548

Patch by Youenn Fablet <youenn@apple.com> on 2017-09-07
Reviewed by Alex Christensen.

* NetworkProcess/cache/CacheStorageEngineConnection.cpp:
(WebKit::CacheStorageEngineConnection::dereference):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@221767 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit/ChangeLog
Source/WebKit/NetworkProcess/cache/CacheStorageEngineConnection.cpp

index 5a62597..b256e8c 100644 (file)
@@ -1,3 +1,13 @@
+2017-09-07  Youenn Fablet  <youenn@apple.com>
+
+        Remove entry from CacheStorageEngineConnection lock map when unlocking a Cache
+        https://bugs.webkit.org/show_bug.cgi?id=176548
+
+        Reviewed by Alex Christensen.
+
+        * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
+        (WebKit::CacheStorageEngineConnection::dereference):
+
 2017-09-07  Chris Dumez  <cdumez@apple.com>
 
         [WK2] Add C API to retrieve the originating page of a WKDownload
index dfd63e6..0fb0e29 100644 (file)
@@ -120,8 +120,11 @@ void CacheStorageEngineConnection::dereference(PAL::SessionID sessionID, uint64_
         return;
 
     ASSERT(referenceResult->value);
-    if (!--referenceResult->value)
-        Engine::from(sessionID).unlock(cacheIdentifier);
+    if (--referenceResult->value)
+        return;
+
+    Engine::from(sessionID).unlock(cacheIdentifier);
+    references.remove(referenceResult);
 }
 
 void CacheStorageEngineConnection::clearMemoryRepresentation(PAL::SessionID sessionID, const String& origin)