1
0
mirror of synced 2025-01-18 06:21:40 +03:00

Added Doctrine_Query::free() to make it possible to help PHPs current GC

This commit is contained in:
romanb 2007-08-29 18:40:58 +00:00
parent 1c24964490
commit 7bedb0b21d

View File

@ -1544,4 +1544,18 @@ class Doctrine_Query extends Doctrine_Query_Abstract implements Countable
return $new; return $new;
} }
/**
* Frees the resources used by the query object. It especially breaks a
* cyclic reference between the query object and it's parsers. This enables
* PHP's current GC to reclaim the memory.
* This method can therefore be used to reduce memory usage when creating a lot
* of query objects during a request.
*/
public function free() {
$this->reset();
$this->_parsers = array();
$this->_dqlParts = array();
$this->_enumParams = array();
}
} }