Merge pull request #1353 from braddunbar/destroy

Fix #1339 - Add Backbone.View#destroy.
This commit is contained in:
brad dunbar
2012-06-03 14:44:08 -07:00
2 changed files with 28 additions and 0 deletions

View File

@@ -1183,6 +1183,13 @@
return this;
},
// **destroy** should clean up any references created by this view,
// preventing memory leaks. The convention is for **destroy** to always
// return `this`.
destroy: function() {
return this;
},
// Remove this view from the DOM. Note that the view isn't present in the
// DOM by default, so calling this method may be a no-op.
remove: function() {