It seems a popup has a m_parent pointer to it's parent surface. Assuming the popup is closed first - the code works.
But if the parent surface is closed first - the surface does not seem to have any
knowledge of it's child popup(s) - and does nothing to destroy them first.
In previous QT versions and windowing systems could be expected that closing a parent window will automatically close any child windows (especially without crashing).
It seems to happen also only when the window decorations are disabled.