mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
API CHANGE: Remove dodgy DataObject::destroy() behaviour, opting instead for using PHP5.3's garbage collector.
This commit is contained in:
parent
e96ca5fb9a
commit
f65a7c6b21
@ -207,6 +207,11 @@ mb_http_output('UTF-8');
|
|||||||
mb_internal_encoding('UTF-8');
|
mb_internal_encoding('UTF-8');
|
||||||
mb_regex_encoding('UTF-8');
|
mb_regex_encoding('UTF-8');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enable better garbage collection
|
||||||
|
*/
|
||||||
|
gc_enable();
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
// INCLUDES
|
// INCLUDES
|
||||||
|
|
||||||
|
@ -408,12 +408,8 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
|
|||||||
* You'll need to call this to get the memory of an object that has components or extensions freed.
|
* You'll need to call this to get the memory of an object that has components or extensions freed.
|
||||||
*/
|
*/
|
||||||
function destroy() {
|
function destroy() {
|
||||||
$this->extension_instances = null;
|
//$this->destroyed = true;
|
||||||
$this->components = null;
|
gc_collect_cycles();
|
||||||
$this->destroyed = true;
|
|
||||||
$this->record = null;
|
|
||||||
$this->original = null;
|
|
||||||
$this->changed = null;
|
|
||||||
$this->flushCache(false);
|
$this->flushCache(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user