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
|
// copy item action listeners
|
||||||
Signal!MenuItemActionHandler onMenuItemActionListenerCopy = onMenuItemActionListener;
|
Signal!MenuItemActionHandler onMenuItemActionListenerCopy = onMenuItemActionListener;
|
||||||
|
|
||||||
|
handleMenuItemClick(item);
|
||||||
|
|
||||||
PopupWidget popup = cast(PopupWidget)parent;
|
PopupWidget popup = cast(PopupWidget)parent;
|
||||||
if (popup)
|
if (popup)
|
||||||
popup.close();
|
popup.close();
|
||||||
|
|
||||||
handleMenuItemClick(item);
|
|
||||||
|
|
||||||
|
|
||||||
// this pointer now can be invalid - if popup removed
|
// this pointer now can be invalid - if popup removed
|
||||||
if (onMenuItemClickListenerCopy.assigned)
|
if (onMenuItemClickListenerCopy.assigned)
|
||||||
if (onMenuItemClickListenerCopy(item))
|
if (onMenuItemClickListenerCopy(item))
|
||||||
|
|
Loading…
Reference in New Issue