Fix #1339 - Add Backbone.View#destroy.

This commit is contained in:
Brad Dunbar
2012-05-28 16:52:59 -04:00
parent 5509e13842
commit dad7e2757e

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() {