derickbailey/backbone.marionette — pull request #95 by tgcondor (2012-05-07 18:37:49+00:00)
Title: Allow close() to synchronize with deferred rendering.

Since rendering could be deferred, `close` may be called before rendering is completed, resulting in orphan DOM elements. To resolve this, save the deferred object from rendering and make close depend on it.

This is only a partial solution since events may trigger multiple render and close events, and it's not clear whether the current solution will handle all cases gracefully.