Commit 5a6c4e2f authored by Addy Osmani's avatar Addy Osmani

Merge pull request #1249 from masrud/master

Fixing a memory leak in the YUI example
parents 36443315 e32c6faa
...@@ -115,6 +115,9 @@ YUI.add('todo-app', function (Y) { ...@@ -115,6 +115,9 @@ YUI.add('todo-app', function (Y) {
fragment.append(view.render().get('container')); fragment.append(view.render().get('container'));
}); });
// To delete previously attached views and fix the memory leak.
this.get('container').one('#todo-list').destroy({recursivePurge: true});
this.get('container').one('#todo-list').setContent(fragment); this.get('container').one('#todo-list').setContent(fragment);
}, },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment