From 0a1c14c01af5c0df86a9cf78ff862c4710a9b700 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Sun, 30 Nov 2014 11:12:03 +0100 Subject: [PATCH] Node: clean up destructor --- library/Bpapp/Node.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/library/Bpapp/Node.php b/library/Bpapp/Node.php index 38e8114..cde423f 100644 --- a/library/Bpapp/Node.php +++ b/library/Bpapp/Node.php @@ -144,15 +144,13 @@ abstract class Node return false; } - public function __destruct() - { - // required to avoid memleeks in PHP < 5.3: - $this->parent = null; - $this->children = array(); - } - public function __toString() { return $this->name; } + + public function __destruct() + { + unset($this->parent); + } }