Struggling a bit to get my head round a problem in Marionette 2.
In various parts of my app I have the following trigger so when the currency is changed the views are rendered.
App.on("currency:change", function() {
cartView.render();
totalsView.render();
});
This works fine on the individual pages if loaded by refreshing the page, but on navigating between 2 pages with this I get the error.
Uncaught ViewDestroyedError: View has already been destroyed and cannot be used.
On investigation it looks it's trying to render a view from the previous page.
Each page is defined by a module which is started and stoped as loaded or closed, and the views seem to being destroyed, so a bit confused as to how this is happening. My first assumption is the views from the previous page haven't been fully removed, but I thought this was something Marionette did automatically.