diff options
author | Maxim Monastirsky <momonasmon@gmail.com> | 2016-10-18 17:24:24 +0300 |
---|---|---|
committer | Maxim Monastirsky <momonasmon@gmail.com> | 2016-10-18 17:27:57 +0300 |
commit | 0eebe7387fd88aaef12fc3e303ed477d0aea6066 (patch) | |
tree | 901d7279ae4a8a991d2bf93a0ba85aa2e6813ddc /vcl | |
parent | b088d89d00cd0716a50219f4eef4da080393fd63 (diff) |
Don't crash on closing gtk3 popup menu without enabled items
This thing:
GtkSalMenu::ShowNativePopupMenu
Menu::Deactivate
MenuItemList::Remove
GtkInstance::DestroyMenuItem
deletes the SalMenuItem, leaving GtkSalMenu with invalid
pointers.
Change-Id: I22ff10fc62421a800d808a56625ce7144c8e04b4
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/window/menu.cxx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index bb2f60d980b6..7af1ad37496d 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -239,7 +239,12 @@ void Menu::Deactivate() { MenuItemData* pData = pItemList->GetDataFromPos( --n ); if ( pData->bIsTemporary ) + { + if ( ImplGetSalMenu() ) + ImplGetSalMenu()->RemoveItem( n ); + pItemList->Remove( n ); + } } bInCallback = true; |