[Libreoffice-commits] core.git: vcl/source
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Wed Feb 10 14:47:57 UTC 2021
vcl/source/window/menu.cxx | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
New commits:
commit 0349ef0fd8d85730e4b2b9f419868b2cef50868c
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Feb 10 12:47:01 2021 +0000
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed Feb 10 15:47:08 2021 +0100
Related: tdf#140225 when clearing pItemList, keep SalMenu in sync
with their removal during menu teardown
Change-Id: Ic5555372112c5717cbc39c38c6172344e807deb5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110703
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index 3cffab6e3b20..aa7afb062f15 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
More information about the Libreoffice-commits
mailing list