documentcloud/backbone — pull request #2403 by tgriesser (2013-03-20 16:36:32+00:00)
Title: Fix for #2392 - cleanup events on invalid or duplicate models

This might not be a common occurrence, but I have a feeling it'll be a tough one to track down when it does happen, since creating a temporary one-off model internally is the only way to reliably check if a model already exists in a collection (due to various issues with parse and how the `id` is set on models).

If there are listeners bound during initialize for a model which is dropped after failing `_prepareModel` or which isn't used because a duplicate exists, then we should cleanup the listeners on that model to be safe.