destroy phpquery document object when destruct Query class

This commit is contained in:
Edwin Xu 2020-03-05 22:18:54 +08:00
parent 46f564bc8b
commit a76ecb4258

View File

@ -15,6 +15,9 @@ use Closure;
class Query
{
protected $html;
/**
* @var \phpQueryObject
*/
protected $document;
protected $rules;
protected $range = null;
@ -268,4 +271,15 @@ class Query
}
return $html;
}
protected function destroyDocument()
{
$this->document->unloadDocument();
unset($this->document);
}
public function __destruct()
{
$this->destroyDocument();
}
}