marionettejs/backbone.marionette — pull request #257 by osama-ibrahim (2012-09-25 12:03:45+00:00)
Title: Fixed an issue when calling `Region.close`, it calls `View.close` even if it's already closed.

### Why?

When we have a `Region` showing a `View` and we close it with `View.close`, later when showing another view in the same region it closes the old view again (even so the view closed itself through `this.close` for example).

### What?

Just added a new flag `isClosed` to mark the view when closed and cancel the call if `View.isClosed === true`.

### Discussion?

I've added two different commits, the first one showing the failing spec, and the second one the fix for it.

Also you can see the issue [here](http://jsfiddle.net/osama/Gyb4B/), using the following steps:
* Click on "Open View 1"
* Click on "Close View 1"
* Click on "Open View 2"

You'll see a log message showing "Closing View 1" being logged twice.