js/core/Binding.js
function () {
            // binding already destroyed?
            if (!this.$) {
                return;
            }
            var e;
            for (var j = 0; j < this.$events.length; j++) {
                e = this.$events[j];
                this.$.scope.unbind(e.eventType, e.callback, this);
            }

            this.$.scope.unbind('destroy', this.destroy, this);

            if (this.$.twoWay === true) {
                this.$.target.unbind(this.$.targetEvent, this._revCallback, this);
            }
            if (this.$subBinding) {
                this.$subBinding.destroy();
                this.$subBinding = null;
            }

            // destroy parameter bindings
            for (var i = 0; i < this.$parameters.length; i++) {
                var par = this.$parameters[i];
                if (par instanceof Binding) {
                    par.destroy();
                }
            }
            this.$parameters = null;
            this.$.scope = this.$.target = this.$.callback = null;
            this.$ = null;
            this.$targets = null;
            this.callBase();

            bindingsDestroyed++;
            if (bindingsDestroyed === 500) {
                if (typeof(CollectGarbage) === "function") {
                    CollectGarbage();
                }
                bindingsDestroyed = 0;
            }
        }
function () {
            // binding already destroyed?
            if (!this.$) {
                return;
            }
            var e;
            for (var j = 0; j < this.$events.length; j++) {
                e = this.$events[j];
                this.$.scope.unbind(e.eventType, e.callback, this);
            }

            this.$.scope.unbind('destroy', this.destroy, this);

            if (this.$.twoWay === true) {
                this.$.target.unbind(this.$.targetEvent, this._revCallback, this);
            }
            if (this.$subBinding) {
                this.$subBinding.destroy();
                this.$subBinding = null;
            }

            // destroy parameter bindings
            for (var i = 0; i < this.$parameters.length; i++) {
                var par = this.$parameters[i];
                if (par instanceof Binding) {
                    par.destroy();
                }
            }
            this.$parameters = null;
            this.$.scope = this.$.target = this.$.callback = null;
            this.$ = null;
            this.$targets = null;
            this.callBase();

            bindingsDestroyed++;
            if (bindingsDestroyed === 500) {
                if (typeof(CollectGarbage) === "function") {
                    CollectGarbage();
                }
                bindingsDestroyed = 0;
            }
        }
function ( ) { // binding already destroyed? if ( ! this . $ ) { return ; } var e ; for ( var j = 0 ; j < this . $events . length ; j ++ ) { e = this . $events [ j ] ; this . $ . scope . unbind ( e . eventType , e . callback , this ) ; } this . $ . scope . unbind ( 'destroy' , this . destroy , this ) ; if ( this . $ . twoWay === true ) { this . $ . target . unbind ( this . $ . targetEvent , this . _revCallback , this ) ; } if ( this . $subBinding ) { this . $subBinding . destroy ( ) ; this . $subBinding = null ; } // destroy parameter bindings for ( var i = 0 ; i < this . $parameters . length ; i ++ ) { var par = this . $parameters [ i ] ; if ( par instanceof Binding ) { par . destroy ( ) ; } } this . $parameters = null ; this . $ . scope = this . $ . target = this . $ . callback = null ; this . $ = null ; this . $targets = null ; this . callBase ( ) ; bindingsDestroyed ++ ; if ( bindingsDestroyed === 500 ) { if ( typeof ( CollectGarbage ) === "function" ) { CollectGarbage ( ) ; } bindingsDestroyed = 0 ; } }
Unbinds all events and destroys subBinding...
Unbinds all events and destroys subBinding ...