Fixed bug #7874: Page lock not released when error page was generated
authorOliver Hader <oliver.hader@typo3.org>
Mon, 17 Mar 2008 18:12:15 +0000 (18:12 +0000)
committerOliver Hader <oliver.hader@typo3.org>
Mon, 17 Mar 2008 18:12:15 +0000 (18:12 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@3454 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_lock.php
typo3/sysext/cms/tslib/class.tslib_fe.php

index 39440b8..d9fa61b 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,7 @@
 
        * Fixed bug #4186: GIFBUILDER cropsized images have bad quality (thanks to Steffen Kamper)
        * Fixed bug #7634: Tabs disappear when BE-editing a record that contains IRRE
+       * Fixed bug #7874: Page lock not released when error page was generated
 
 2008-03-17  Jeff Segars  <jeff@webempoweredchurch.org>
 
index b0737fe..e7653b9 100644 (file)
@@ -128,6 +128,16 @@ class t3lib_lock {
        }
 
        /**
+        * Destructor:
+        * Releases lock automatically when instance is destroyed.
+        *
+        * @return      void
+        */
+       function __destruct() {
+               $this->release();
+       }
+
+       /**
         * Acquire a lock and return when successful. If the lock is already open, the client will be
         *
         * It is important to know that the lock will be acquired in any case, even if the request was blocked first. Therefore, the lock needs to be released in every situation.
index 50a1765..e573ca6 100755 (executable)
@@ -2864,13 +2864,13 @@ require_once (PATH_t3lib.'class.t3lib_lock.php');
         * @return      boolean         Returns true on success, false otherwise
         * @see acquirePageGenerationLock()
         */
-       function releasePageGenerationLock(&$lockObj)   {
+       function releasePageGenerationLock(&$lockObj) {
                $success = false;
                        // If lock object is set and was aquired (may also happen if no_cache was enabled during runtime), release it:
                if (is_object($lockObj) && $lockObj instanceof t3lib_lock && $lockObj->getLockStatus()) {
                        $success = $lockObj->release();
                        $lockObj->sysLog('Released lock');
-                       unset($lockObj);
+                       $lockObj = null;
                        // Otherwise, if caching is disabled, no locking is required:
                } elseif ($this->no_cache || $this->headerNoCache()) {
                        $success = true;