stdlib/widget.js
function _destroy() {
            var childrenLength;

            if (this.element) {
                this.element.remove();
            }

            if (this.children !== null){
                childrenLength = this.children.length;
                while(childrenLength > 0){
                    this.children[0].destroy();
                    if (this.children.length === childrenLength) {
                        this.children.shift();
                    }
                    childrenLength--;
                }
            }

            if (this.parent) {
                this.parent.removeChild(this);
            }

            this.children       = null;
            this.element        = null;
        }
function _destroy() {
            var childrenLength;

            if (this.element) {
                this.element.remove();
            }

            if (this.children !== null){
                childrenLength = this.children.length;
                while(childrenLength > 0){
                    this.children[0].destroy();
                    if (this.children.length === childrenLength) {
                        this.children.shift();
                    }
                    childrenLength--;
                }
            }

            if (this.parent) {
                this.parent.removeChild(this);
            }

            this.children       = null;
            this.element        = null;
        }
function _destroy ( ) { var childrenLength ; if ( this . element ) { this . element . remove ( ) ; } if ( this . children !== null ) { childrenLength = this . children . length ; while ( childrenLength > 0 ) { this . children [ 0 ] . destroy ( ) ; if ( this . children . length === childrenLength ) { this . children . shift ( ) ; } childrenLength -- ; } } if ( this . parent ) { this . parent . removeChild ( this ) ; } this . children = null ; this . element = null ; }
Destroy implementation. Its main responsabilities are cleaning
all references to other objects so garbage collector can collect
the memory used by this and the other objects
@property _destroy <private> [Function]
@method
@return undefined [undefined]
Destroy implementation . Its main responsabilities are cleaning all references to other objects so garbage collector can collect the memory used by this and the other objects