Browse files

API CHANGE: Remove dodgy DataObject::destroy() behaviour, opting inst…

…ead for using PHP5.3's garbage collector.
  • Loading branch information...
1 parent e96ca5f commit f65a7c6b212caee8ad0b4036324962592266f87c @sminnee sminnee committed Jun 11, 2012
Showing with 7 additions and 6 deletions.
  1. +5 −0 core/Core.php
  2. +2 −6 model/DataObject.php
View
5 core/Core.php
@@ -207,6 +207,11 @@
mb_internal_encoding('UTF-8');
mb_regex_encoding('UTF-8');
+/**
+ * Enable better garbage collection
+ */
+gc_enable();
+
///////////////////////////////////////////////////////////////////////////////
// INCLUDES
View
8 model/DataObject.php
@@ -408,12 +408,8 @@ function setDataModel(DataModel $model) {
* You'll need to call this to get the memory of an object that has components or extensions freed.
*/
function destroy() {
- $this->extension_instances = null;
- $this->components = null;
- $this->destroyed = true;
- $this->record = null;
- $this->original = null;
- $this->changed = null;
+ //$this->destroyed = true;
+ gc_collect_cycles();
$this->flushCache(false);
}

0 comments on commit f65a7c6

Please sign in to comment.