From 367607ae97ca6c078e9ad6a3e7c3e41a27c4566c Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Tue, 26 Aug 2008 06:48:24 +0000 Subject: [PATCH] Added __destruct(), for stable pseudo-branch --- includes/parser/Parser.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index 6e3b932a68..8bd9a03422 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -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 */ -- 2.20.1