Add dirty flag. Ask the user whether to save the changes before quitting