vcl/qt5/Qt5Menu.cxx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
New commits: commit 35b59e56cc01e5ecf97583ab7b7884d301457089 Author: Aleksei Nikiforov <darktemp...@basealt.ru> AuthorDate: Thu Jan 10 15:54:56 2019 +0300 Commit: Thorsten Behrens <thorsten.behr...@cib.de> CommitDate: Fri Jan 11 14:46:05 2019 +0100 Unregister action when menu item is removed Change-Id: I9fc5e6630560f285eeb7ef4dbc5e39ccabd5f0df Reviewed-on: https://gerrit.libreoffice.org/66147 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behr...@cib.de> diff --git a/vcl/qt5/Qt5Menu.cxx b/vcl/qt5/Qt5Menu.cxx index 51fca6cff27b..648ceb29ade6 100644 --- a/vcl/qt5/Qt5Menu.cxx +++ b/vcl/qt5/Qt5Menu.cxx @@ -185,7 +185,15 @@ void Qt5Menu::InsertItem(SalMenuItem* pSalMenuItem, unsigned nPos) void Qt5Menu::RemoveItem(unsigned nPos) { SolarMutexGuard aGuard; - maItems.erase(maItems.begin() + nPos); + + if (nPos < maItems.size()) + { + Qt5MenuItem* pItem = maItems[nPos]; + pItem->mpAction.reset(); + pItem->mpMenu.reset(); + + maItems.erase(maItems.begin() + nPos); + } } void Qt5Menu::SetSubMenu(SalMenuItem* pSalMenuItem, SalMenu* pSubMenu, unsigned) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits