From dad7e2757ef54b91030ce47347e0b6805dead561 Mon Sep 17 00:00:00 2001 From: Brad Dunbar Date: Mon, 28 May 2012 16:52:59 -0400 Subject: [PATCH] Fix #1339 - Add Backbone.View#destroy. --- backbone.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/backbone.js b/backbone.js index f1728acc..351e137c 100644 --- a/backbone.js +++ b/backbone.js @@ -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() {