mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-17 07:40:22 +00:00
fix($rootScope): workaround for Chrome's memleak
Under certain circumstances chrome fails to GC scopes because of buggy optimizations and caching. Nulling out references to (not from!) other scopes helps Chrome to realize that this object should be GC-ed. This is really just a workaround as the real problem needs to be fixed in Chrome. See discusstion at: https://github.com/angular/angular.js/issues/1313#issuecomment-10378451 And chrome bug at: https://code.google.com/p/v8/issues/detail?id=2073 Closes #1313
This commit is contained in:
parent
19a324ce11
commit
bd524fc4e5
1 changed files with 5 additions and 0 deletions
|
|
@ -476,6 +476,11 @@ function $RootScopeProvider(){
|
|||
if (parent.$$childTail == this) parent.$$childTail = this.$$prevSibling;
|
||||
if (this.$$prevSibling) this.$$prevSibling.$$nextSibling = this.$$nextSibling;
|
||||
if (this.$$nextSibling) this.$$nextSibling.$$prevSibling = this.$$prevSibling;
|
||||
|
||||
// This is bogus code that works around Chrome's GC leak
|
||||
// see: https://github.com/angular/angular.js/issues/1313#issuecomment-10378451
|
||||
this.$parent = this.$$nextSibling = this.$$prevSibling = this.$$childHead =
|
||||
this.$$childTail = null;
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue