documentcloud/backbone — pull request #1592 by paulmillr (2012-08-28 12:47:41+00:00)
Title: Add Model#dispose & Collection#dispose.

A couple questions (that are [Chaplin](https://github.com/chaplinjs/chaplin) features), about making stuff more useful:

1. Should all disposable properties emit `dispose` event on disposal? Real-world use case:

```coffeescript
# Create edit form on top of the post view.
editPost: (event) =>
@$('.post-text').remove()
editPostView = new EditPostFormView
model: @model,
container: @$('.post-content')
editPostView.on 'dispose', @render
@subview 'editPostForm', editPostView
```

2. Should all disposable properties `delete` some default properties which Backbone sets to free more memory? For example, in Views:

```
['el', '$el', 'options', 'model', 'collection']
```

3. Should all disposable properties do `if (Object.freeze) Object.freeze(this);`? Reason: less bugs in browsers that developers use / debug most of the time == less bugs in apps.