mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-17 07:40:22 +00:00
fix(ng:options): remove memory leak caused by scope.
$new can't be used for creation of temporary scopes because it registers an onEval listener that doesn't go away and keeps the scope around, we must use inherit(scope) instead to avoid this issue. The issue does not apply to the master branch with the new scope which has a scope descructor to clean up this mess.
This commit is contained in:
parent
ac6e1306ec
commit
6aa04b1db4
1 changed files with 2 additions and 2 deletions
|
|
@ -733,7 +733,7 @@ angularWidget('select', function(element){
|
|||
var optionGroup,
|
||||
collection = valuesFn(scope) || [],
|
||||
key = selectElement.val(),
|
||||
tempScope = scope.$new(),
|
||||
tempScope = inherit(scope),
|
||||
value, optionElement, index, groupIndex, length, groupLength;
|
||||
|
||||
try {
|
||||
|
|
@ -791,7 +791,7 @@ angularWidget('select', function(element){
|
|||
fragment,
|
||||
groupIndex, index,
|
||||
optionElement,
|
||||
optionScope = scope.$new(),
|
||||
optionScope = inherit(scope),
|
||||
modelValue = model.get(),
|
||||
selected,
|
||||
selectedSet = false, // nothing is selected yet
|
||||
|
|
|
|||
Loading…
Reference in a new issue