Skip to content

Commit

Permalink
perf(rootScope): Fix a memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
realityking committed Feb 25, 2015
1 parent 581ee9d commit 31e3b7f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/ng/rootScope.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ function $RootScopeProvider() {
this.$get = ['$injector', '$exceptionHandler', '$parse', '$browser',
function($injector, $exceptionHandler, $parse, $browser) {

function destroyChildScope($event) {
$event.currentScope.$$destroyed = true;
}

/**
* @ngdoc type
* @name $rootScope.Scope
Expand Down Expand Up @@ -236,10 +240,6 @@ function $RootScopeProvider() {
if (isolate || parent != this) child.$on('$destroy', destroyChild);

return child;

function destroyChild() {
child.$$destroyed = true;
}
},

/**
Expand Down

0 comments on commit 31e3b7f

Please sign in to comment.