use SmSaveGlobal to log out. this will make apps save their documents or whatever...