Check for unsaved documents on close