diff options
| author | Misko Hevery | 2010-02-05 14:13:19 -0800 |
|---|---|---|
| committer | Misko Hevery | 2010-02-05 14:13:19 -0800 |
| commit | 6d75afe6d2ea26bb412becd1e8f7cab8031eaab4 (patch) | |
| tree | 980df6860e2d93eb528bfd59841b6da2f4a87e2b /src/Widgets.js | |
| parent | 5eb440c22bb87b1d69c14193954620b9f1cec023 (diff) | |
| download | angular.js-6d75afe6d2ea26bb412becd1e8f7cab8031eaab4.tar.bz2 | |
fixed memory leak on repeaters
Diffstat (limited to 'src/Widgets.js')
| -rw-r--r-- | src/Widgets.js | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/Widgets.js b/src/Widgets.js index 5e844ae0..6eb2acc3 100644 --- a/src/Widgets.js +++ b/src/Widgets.js @@ -425,7 +425,6 @@ function BindUpdater(view, exp) { this.view = view; this.exp = Binder.parseBindings(exp); this.hasError = false; - this.scopeSelf = {element:view}; }; BindUpdater.toText = function(obj) { @@ -481,7 +480,7 @@ BindUpdater.prototype = { var part = parts[i]; var binding = Binder.binding(part); if (binding) { - scope.evalWidget(this, binding, this.scopeSelf, function(value){ + scope.evalWidget(this, binding, {element:this.view}, function(value){ html.push(BindUpdater.toText(value)); }, function(e, text){ setHtml(this.view, text); @@ -700,8 +699,7 @@ RepeaterUpdater.prototype = { }); // shrink children for ( var r = childrenLength; r > iteratorLength; --r) { - var unneeded = this.children.pop().element[0]; - unneeded.parentNode.removeChild(unneeded); + this.children.pop().element.remove(); } // Special case for option in select if (child && child.element[0].nodeName === "OPTION") { |
