Assigning a new WPopupMenu to a WPushButton that already contains a WPopupMenu
WPushButton::setMenu() is used, the
WPopupMenu is moved to the button, so that when the button is removed, the popup is also cleared.
However, move semantics appear to be misbehaving here?
unique_ptr's documentation states:
The object is disposed of, using the associated deleter when either of the following happens: - the managing unique_ptr object is assigned another pointer via operator= or reset().
If however, the button is already managing a popup, the original popup is deleted, but the move that would assign the new popup to the button, does not go through. Essentially removing both popups.