diff options
author | Noel Grandin <noel@peralex.com> | 2016-07-05 14:47:16 +0200 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2016-07-05 21:04:15 +0000 |
commit | 2a23d9cc4d5d3e746fec62a41bf85bb81a4c299d (patch) | |
tree | 72ebdcb4e0d5ad5ce75193b13b308a986dd0cdbc /vcl | |
parent | 6f0e3d508dea229e456e3b29abe2f2b3c77a2cf9 (diff) |
when disposing popup menus, don't leave dangling pointers
Change-Id: Ia1b49937ba0693a567097367b99b75a3011666bf
Reviewed-on: https://gerrit.libreoffice.org/26960
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/window/menu.cxx | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index c5e32f6118de..f146be47f48d 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -831,6 +831,13 @@ PopupMenu* Menu::GetPopupMenu( sal_uInt16 nItemId ) const return nullptr; } +void Menu::DisposePopupMenu( sal_uInt16 nItemId ) +{ + MenuItemData* pData = pItemList->GetData( nItemId ); + if ( pData ) + pData->pSubMenu.disposeAndClear(); +} + void Menu::SetAccelKey( sal_uInt16 nItemId, const KeyCode& rKeyCode ) { size_t nPos; |