jackbone.js
function () {

            var that = this;
            var now = +new Date();
            var toRemove = _(this.controllers).filter(function (c) {
                var age = (now - c.lastView);
                return (age > 60000); // Keep in cache for 1 minute.
            });

            _(toRemove).each(function (c) {
                if (c.controller !== that.currentController) {
                    delete that.controllers[c.pageUID];
                    c.controller.destroy();
                    if (c.controller._rootView) {
                        c.controller._rootView.clean();
                        c.controller._rootView.remove();
                        Jackbone.trigger("destroyview", c.controller._rootView);
                    }
                }
            });
        }
function () {

            var that = this;
            var now = +new Date();
            var toRemove = _(this.controllers).filter(function (c) {
                var age = (now - c.lastView);
                return (age > 60000); // Keep in cache for 1 minute.
            });

            _(toRemove).each(function (c) {
                if (c.controller !== that.currentController) {
                    delete that.controllers[c.pageUID];
                    c.controller.destroy();
                    if (c.controller._rootView) {
                        c.controller._rootView.clean();
                        c.controller._rootView.remove();
                        Jackbone.trigger("destroyview", c.controller._rootView);
                    }
                }
            });
        }
function ( ) { var that = this ; var now = + new Date ( ) ; var toRemove = _ ( this . controllers ) . filter ( function ( c ) { var age = ( now - c . lastView ) ; return ( age > 60000 ) ; // Keep in cache for 1 minute. } ) ; _ ( toRemove ) . each ( function ( c ) { if ( c . controller !== that . currentController ) { delete that . controllers [ c . pageUID ] ; c . controller . destroy ( ) ; if ( c . controller . _rootView ) { c . controller . _rootView . clean ( ) ; c . controller . _rootView . remove ( ) ; Jackbone . trigger ( "destroyview" , c . controller . _rootView ) ; } } } ) ; }
Garbage collector, removes unused views and controllers.
Garbage collector removes unused views and controllers .