mirror of https://github.com/buggins/dlangui.git
MenuWidgetBase: onMenuItem() now destroys popup *after* handleMenuItemClick() to help prevent MenuItem "item" from being invalidated prematurely
This commit is contained in:
parent
9f4b8e47eb
commit
1b11e24f05
|
@ -527,13 +527,12 @@ class MenuWidgetBase : ListWidget {
|
|||
// copy item action listeners
|
||||
Signal!MenuItemActionHandler onMenuItemActionListenerCopy = onMenuItemActionListener;
|
||||
|
||||
handleMenuItemClick(item);
|
||||
|
||||
PopupWidget popup = cast(PopupWidget)parent;
|
||||
if (popup)
|
||||
popup.close();
|
||||
|
||||
handleMenuItemClick(item);
|
||||
|
||||
|
||||
// this pointer now can be invalid - if popup removed
|
||||
if (onMenuItemClickListenerCopy.assigned)
|
||||
if (onMenuItemClickListenerCopy(item))
|
||||
|
|
Loading…
Reference in New Issue