delete subwindows before parent window on resize to prevent memory leaks