free up memory when releasing the last shared lock

This commit is contained in:
Robin Appelman 2016-05-02 14:18:46 +02:00
parent de97110f58
commit e36d70c0de
1 changed files with 3 additions and 0 deletions

View File

@ -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]);