how can I execute some code before mainwindow is close

Printable View