Piwik\DataTable::__destruct PHP Method

__destruct() public method

Destructor. Makes sure DataTable memory will be cleaned up.
public __destruct ( )
    public function __destruct()
    {
        static $depth = 0;
        // destruct can be called several times
        if ($depth < self::$maximumDepthLevelAllowed && isset($this->rows)) {
            $depth++;
            foreach ($this->rows as $row) {
                Common::destroy($row);
            }
            if (isset($this->summaryRow)) {
                Common::destroy($this->summaryRow);
            }
            unset($this->rows);
            Manager::getInstance()->setTableDeleted($this->currentId);
            $depth--;
        }
    }