Added __destruct(), for stable pseudo-branch
authorTim Starling <tstarling@users.mediawiki.org>
Tue, 26 Aug 2008 06:48:24 +0000 (06:48 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Tue, 26 Aug 2008 06:48:24 +0000 (06:48 +0000)
includes/parser/Parser.php

index 6e3b932..8bd9a03 100644 (file)
@@ -142,6 +142,15 @@ class Parser
                $this->mFirstCall = true;
        }
 
+       /**
+        * Reduce memory usage to reduce the impact of circular references
+        */
+       function __destruct() {
+               foreach ( $this as $name => $value ) {
+                       unset( $this->$name );
+               }
+       }
+
        /**
         * Do various kinds of initialisation on the first call of the parser
         */