Make the main window cleanup when popout is closed