diff options
| author | Igor Minar | 2011-08-20 22:32:55 -0700 | 
|---|---|---|
| committer | Igor Minar | 2011-08-21 01:12:34 -0700 | 
| commit | 6aa04b1db48853340d720e0a1a3e325ac523a06f (patch) | |
| tree | c45f1302b15a8b2440dc82f63f270583acad915b /src | |
| parent | ac6e1306ec2126f9c8e67b4a26d8f03001abf73d (diff) | |
| download | angular.js-6aa04b1db48853340d720e0a1a3e325ac523a06f.tar.bz2 | |
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/widgets.js | 4 | 
1 files changed, 2 insertions, 2 deletions
| diff --git a/src/widgets.js b/src/widgets.js index 4a2820c9..4bd7654f 100644 --- a/src/widgets.js +++ b/src/widgets.js @@ -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 | 
