From: Aaron Schulz Date: Sat, 2 Jun 2012 22:13:31 +0000 (-0700) Subject: Fixed destructor in FSLockManager to clear all the locks. X-Git-Tag: 1.31.0-rc.0~23406^2 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/ajouter.php?a=commitdiff_plain;h=2f06a9931a42daddaccba5970c3acb1ca62456b4;p=lhc%2Fweb%2Fwiklou.git Fixed destructor in FSLockManager to clear all the locks. Change-Id: I019d24c19f317eb649b5a0415618b453e1ea171b --- diff --git a/includes/filerepo/backend/lockmanager/FSLockManager.php b/includes/filerepo/backend/lockmanager/FSLockManager.php index 4f3b9596ec..2b727a8fd3 100644 --- a/includes/filerepo/backend/lockmanager/FSLockManager.php +++ b/includes/filerepo/backend/lockmanager/FSLockManager.php @@ -239,11 +239,15 @@ class FSLockManager extends LockManager { return "{$this->lockDir}/{$hash}.lock"; } + /** + * Make sure remaining locks get cleared for sanity + */ function __destruct() { - // Make sure remaining locks get cleared for sanity - foreach ( $this->locksHeld as $path => $locks ) { - $this->doSingleUnlock( $path, self::LOCK_EX ); - $this->doSingleUnlock( $path, self::LOCK_SH ); + while ( count( $this->locksHeld ) ) { + foreach ( $this->locksHeld as $path => $locks ) { + $this->doSingleUnlock( $path, self::LOCK_EX ); + $this->doSingleUnlock( $path, self::LOCK_SH ); + } } } }