diff --git a/src/Dom/Query.php b/src/Dom/Query.php index 21ca77a..6e1cb11 100644 --- a/src/Dom/Query.php +++ b/src/Dom/Query.php @@ -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; } -} \ No newline at end of file + + protected function destroyDocument() + { + $this->document->unloadDocument(); + unset($this->document); + } + + public function __destruct() + { + $this->destroyDocument(); + } +}