diff --git a/LiteDB/Engine/Disk/MemoryCache.cs b/LiteDB/Engine/Disk/MemoryCache.cs index 112bf58a6..f82947dba 100644 --- a/LiteDB/Engine/Disk/MemoryCache.cs +++ b/LiteDB/Engine/Disk/MemoryCache.cs @@ -222,6 +222,10 @@ public PageBuffer MoveToReadable(PageBuffer page) added = false; + // Bug 2184: readable page was updated, need to set the page.ShareCounter back to writeable + // so that DiscardPage can free the page and put it into the queue. + page.ShareCounter = BUFFER_WRITABLE; + return current; });