Add a __destruct to Profile.
authorRaphaël Barrois <raphael.barrois@polytechnique.org>
Sun, 3 Jun 2012 11:37:17 +0000 (13:37 +0200)
committerRaphaël Barrois <raphael.barrois@polytechnique.org>
Sun, 3 Jun 2012 11:37:24 +0000 (13:37 +0200)
Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org>
classes/profile.php

index b11e31d..a05ed66 100644 (file)
@@ -171,6 +171,13 @@ class Profile implements PlExportable
         $this->visibility = $visibility;
     }
 
+    private function __destruct()
+    {
+        // Need to delete objects allocated by the profile
+        // http://www.php.net/manual/en/function.unset.php#98692
+        unset($this->owner);
+    }
+
     public function id()
     {
         return $this->pid;