Skip to content

Commit

Permalink
API CHANGE: Remove dodgy DataObject::destroy() behaviour, opting inst…
Browse files Browse the repository at this point in the history
…ead for using PHP5.3's garbage collector.
  • Loading branch information
Sam Minnee committed Jun 11, 2012
1 parent e96ca5f commit f65a7c6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
5 changes: 5 additions & 0 deletions core/Core.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,11 @@
mb_internal_encoding('UTF-8');
mb_regex_encoding('UTF-8');

/**
* Enable better garbage collection
*/
gc_enable();

///////////////////////////////////////////////////////////////////////////////
// INCLUDES

Expand Down
8 changes: 2 additions & 6 deletions model/DataObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit f65a7c6

Please sign in to comment.