From 9677681a37b2e999558f30e9383ea2a9bf9f8c24 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Mon, 2 May 2016 14:18:46 +0200 Subject: [PATCH] free up memory when releasing the last shared lock --- lib/private/Lock/AbstractLockingProvider.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/private/Lock/AbstractLockingProvider.php b/lib/private/Lock/AbstractLockingProvider.php index f96358778c..9497729015 100644 --- a/lib/private/Lock/AbstractLockingProvider.php +++ b/lib/private/Lock/AbstractLockingProvider.php @@ -77,6 +77,9 @@ abstract class AbstractLockingProvider implements ILockingProvider { if ($type === self::LOCK_SHARED) { if (isset($this->acquiredLocks['shared'][$path]) and $this->acquiredLocks['shared'][$path] > 0) { $this->acquiredLocks['shared'][$path]--; + if ($this->acquiredLocks['shared'][$path] === 0) { + unset($this->acquiredLocks['shared'][$path]); + } } } else if ($type === self::LOCK_EXCLUSIVE) { unset($this->acquiredLocks['exclusive'][$path]);