[icinga-checkins] icinga.org: icingaweb2-module-director/master: Icinga/DbObject: explizit destruction

git at icinga.org git at icinga.org
Thu Feb 4 16:58:49 CET 2016


Module: icingaweb2-module-director
Branch: master
Commit: 88ffc6baf2a0d9fb4d1b00b19e315e11b992d6b5
URL:    https://git.icinga.org/?p=icingaweb2-module-director.git;a=commit;h=88ffc6baf2a0d9fb4d1b00b19e315e11b992d6b5

Author: Thomas Gelf <thomas at gelf.net>
Date:   Thu Feb  4 16:58:32 2016 +0100

Icinga/DbObject: explizit destruction

---

 library/Director/Data/Db/DbObject.php     |    6 ++++++
 library/Director/Objects/IcingaObject.php |   13 +++++++++++++
 2 files changed, 19 insertions(+)

diff --git a/library/Director/Data/Db/DbObject.php b/library/Director/Data/Db/DbObject.php
index 733166f..c4f0b8b 100644
--- a/library/Director/Data/Db/DbObject.php
+++ b/library/Director/Data/Db/DbObject.php
@@ -966,4 +966,10 @@ abstract class DbObject
         $obj->setConnection($connection)->setKey($id);
         return $obj->existsInDb();
     }
+
+    public function __destruct()
+    {
+        unset($this->db);
+        unset($this->connection);
+    }
 }
diff --git a/library/Director/Objects/IcingaObject.php b/library/Director/Objects/IcingaObject.php
index 31f6944..4162b6d 100644
--- a/library/Director/Objects/IcingaObject.php
+++ b/library/Director/Objects/IcingaObject.php
@@ -1125,4 +1125,17 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer
             }
         }
     }
+
+    public function __destruct()
+    {
+        unset($this->resolveCache);
+        unset($this->vars);
+        unset($this->groups);
+        unset($this->imports);
+        unset($this->ranges);
+        unset($this->arguments);
+
+
+        parent::__destruct();
+    }
 }



More information about the icinga-checkins mailing list