diff --git a/src/ng/rootScope.js b/src/ng/rootScope.js index 904f24d4c6d5..a2e8ff125dff 100644 --- a/src/ng/rootScope.js +++ b/src/ng/rootScope.js @@ -187,6 +187,19 @@ function $RootScopeProvider(){ } else { this.$$childHead = this.$$childTail = child; } + + // Help out chrome's GC + child.$on('$destroy', function() { + if(Child) + Child.prototype = null; + // Async so that the $broadcast('$destroy') can traverse the rest + setTimeout(function() { + child.__proto__ = {}; + for(var i in child) + delete child[i]; + child = null; + }); + }); return child; },