aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--includes/filerepo/backend/lockmanager/FSLockManager.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/includes/filerepo/backend/lockmanager/FSLockManager.php b/includes/filerepo/backend/lockmanager/FSLockManager.php
index 2b727a8fd3ea..53f3e9f974e8 100644
--- a/includes/filerepo/backend/lockmanager/FSLockManager.php
+++ b/includes/filerepo/backend/lockmanager/FSLockManager.php
@@ -176,6 +176,9 @@ class FSLockManager extends LockManager {
unset( $this->handles[$path][$type] );
}
}
+ if ( !count( $this->locksHeld[$path] ) ) {
+ unset( $this->locksHeld[$path] ); // no locks on this path
+ }
// Unlock handles to release locks and delete
// any lock files that end up with no locks on them...
if ( wfIsWindows() ) {
@@ -218,12 +221,11 @@ class FSLockManager extends LockManager {
*/
private function pruneKeyLockFiles( $path ) {
$status = Status::newGood();
- if ( !count( $this->locksHeld[$path] ) ) {
+ if ( !isset( $this->locksHeld[$path] ) ) {
# No locks are held for the lock file anymore
if ( !unlink( $this->getLockPath( $path ) ) ) {
$status->warning( 'lockmanager-fail-deletelock', $path );
}
- unset( $this->locksHeld[$path] );
unset( $this->handles[$path] );
}
return $status;