Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 553c252

Browse files
committed
revert: fix(Scope): aggressively clean up scope on $destroy to minimize leaks
This reverts commit f552f25. The commit is causing regressions. Closes #6897
1 parent e145a8d commit 553c252

File tree

1 file changed

+4
-15
lines changed

1 file changed

+4
-15
lines changed

src/ng/rootScope.js

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -731,26 +731,15 @@ function $RootScopeProvider(){
731731

732732
forEach(this.$$listenerCount, bind(null, decrementListenerCount, this));
733733

734-
// sever all the references to parent scopes (after this cleanup, the current scope should
735-
// not be retained by any of our references and should be eligible for garbage collection)
736734
if (parent.$$childHead == this) parent.$$childHead = this.$$nextSibling;
737735
if (parent.$$childTail == this) parent.$$childTail = this.$$prevSibling;
738736
if (this.$$prevSibling) this.$$prevSibling.$$nextSibling = this.$$nextSibling;
739737
if (this.$$nextSibling) this.$$nextSibling.$$prevSibling = this.$$prevSibling;
740738

741-
// This is bogus code that works around V8's memory leak coming from ICs
742-
// see: https://code.google.com/p/v8/issues/detail?id=2073#c26
743-
//
744-
// for more info also see:
745-
// - https://github.com/angular/angular.js/issues/6794#issuecomment-38648909
746-
// - https://github.com/angular/angular.js/issues/1313#issuecomment-10378451
747-
for (var prop in this) {
748-
if (hasOwnProperty.call(this, prop)) {
749-
this[prop] = null;
750-
}
751-
}
752-
// recreate the $$destroyed flag
753-
this.$$destroyed = true;
739+
// This is bogus code that works around Chrome's GC leak
740+
// see: https://github.com/angular/angular.js/issues/1313#issuecomment-10378451
741+
this.$parent = this.$$nextSibling = this.$$prevSibling = this.$$childHead =
742+
this.$$childTail = null;
754743
},
755744

756745
/**

0 commit comments

Comments
 (0)