fix on_close_event  demag_gui

fix on_close_event demag_gui