auto-save all documents when project is closed or cocosbuilder is about to
 be exited. also when a save is requested, save all dirty documents..