Exemplo n.º 1
0
 /**
  * "Destructor": forcibly free all references held by this frame
  *
  * @param bool $recursive if true, call dispose on all children
  */
 public function dispose($recursive = false)
 {
     if ($recursive) {
         while ($child = $this->_first_child) {
             $child->dispose(true);
         }
     }
     // Remove this frame from the tree
     if ($this->_prev_sibling) {
         $this->_prev_sibling->_next_sibling = $this->_next_sibling;
     }
     if ($this->_next_sibling) {
         $this->_next_sibling->_prev_sibling = $this->_prev_sibling;
     }
     if ($this->_parent && $this->_parent->_first_child === $this) {
         $this->_parent->_first_child = $this->_next_sibling;
     }
     if ($this->_parent && $this->_parent->_last_child === $this) {
         $this->_parent->_last_child = $this->_prev_sibling;
     }
     if ($this->_parent) {
         $this->_parent->get_node()->removeChild($this->_node);
     }
     $this->_style->dispose();
     $this->_style = null;
     unset($this->_style);
     $this->_original_style->dispose();
     $this->_original_style = null;
     unset($this->_original_style);
 }