Fixing crash if any views had unsaved files