Usually it is best to turn things and delete in in Close override (which basically is invoked when you activate close from windows or window manager) or in WhenClose.
Generally, you can call it whenever you see fit. delete closes the window if it is open.