summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2016-05-02 14:18:46 +0200
committerRobin Appelman <icewind@owncloud.com>2016-05-02 14:18:46 +0200
commit9677681a37b2e999558f30e9383ea2a9bf9f8c24 (patch)
treebbdfcf6b8cb97ed9d5bce300ec34d625f150ff3b
parent5b45f0f91448f109ff33d4fb03368a0405e1da10 (diff)
downloadnextcloud-server-9677681a37b2e999558f30e9383ea2a9bf9f8c24.tar.gz
nextcloud-server-9677681a37b2e999558f30e9383ea2a9bf9f8c24.zip
free up memory when releasing the last shared lock
-rw-r--r--lib/private/Lock/AbstractLockingProvider.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/private/Lock/AbstractLockingProvider.php b/lib/private/Lock/AbstractLockingProvider.php
index f96358778c1..94977290155 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]);