Merge pull request #102 from edwinhuish/auto-destroy-phpquery-document
destroy phpquery document object when destruct Query class
This commit is contained in:
commit
6ee6a26aee
@ -15,6 +15,9 @@ use Closure;
|
|||||||
class Query
|
class Query
|
||||||
{
|
{
|
||||||
protected $html;
|
protected $html;
|
||||||
|
/**
|
||||||
|
* @var \phpQueryObject
|
||||||
|
*/
|
||||||
protected $document;
|
protected $document;
|
||||||
protected $rules;
|
protected $rules;
|
||||||
protected $range = null;
|
protected $range = null;
|
||||||
@ -268,4 +271,15 @@ class Query
|
|||||||
}
|
}
|
||||||
return $html;
|
return $html;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
protected function destroyDocument()
|
||||||
|
{
|
||||||
|
$this->document->unloadDocument();
|
||||||
|
unset($this->document);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function __destruct()
|
||||||
|
{
|
||||||
|
$this->destroyDocument();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user