derickbailey/backbone.marionette — pull request #102 by ClemensSchneider (2012-05-10 08:46:19+00:00)
Title: do not render a view if it has already been closed

when a view has been closed while rendering was still waiting for a
deferred to resolve (e.g. waiting for data- or template retrieval) its
markup should not be appended.

The only thing I'm not really sure about is, if the deferredRender in the ItemView should be resolved or rejected (probably rejecting the deferredRender is more appropriate?)

In my case I had many changes (add, reset, remove) on a collection that was rendered via CollectionView. While the ItemViews were still waiting for the template-retrieval to resolve, they had already been closed (due to a collection:remove) but after template-retrieval resolved, their markup got rendered nevertheless.