diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-02-08 13:49:53 +0000 |
---|---|---|
committer | Adolfo Jayme Barrientos <fitojb@ubuntu.com> | 2021-02-13 16:16:21 +0100 |
commit | 4abe4e9c92641896b4a0949e8a64a231d2f41c86 (patch) | |
tree | d9db192ed7da980a8569e9dd544c534ca8ed4759 /vcl/source | |
parent | dc19de67d6c7f30157b7196773589bba30d9e02f (diff) |
tdf#140225 call cancel before destroying menubar
a) in case there are some menus open cancel them before removing
their parent menubar
b) before a GtkSalMenu is deleted clear the action-group of its members
squash of...
Related: tdf#140225 ignore activate/deactivate of a disposed VclMenu
prep work for improved solution for tdf#140225
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110699
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Related: tdf#140225 when clearing pItemList, keep SalMenu in sync
with their removal during menu teardown
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110703
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Resolves: tdf#140225 remove action when item is removed from GtkSalMenu
and we have previously ensured that all items are removed by
Menu::dispose before GtkSalMenu dtor is called
Change-Id: I9ec59c52c72b8b58976a8ee41727ca7612ebf6b1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110564
Tested-by: Jenkins
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/window/menu.cxx | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index eacfb865ffcd..7d4a34678ada 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -213,7 +213,18 @@ void Menu::dispose() bKilled = true; - pItemList->Clear(); + // tdf#140225 when clearing pItemList, keep SalMenu in sync with + // their removal during menu teardown + for (size_t n = pItemList->size(); n;) + { + --n; + if (mpSalMenu) + mpSalMenu->RemoveItem(n); + pItemList->Remove(n); + } + + assert(!pItemList->size()); + mpLayoutData.reset(); // Native-support: destroy SalMenu |