summaryrefslogtreecommitdiff
path: root/include/vcl/menu.hxx
diff options
context:
space:
mode:
authorAron Budea <aron.budea@collabora.com>2017-04-03 02:21:28 +0200
committerAron Budea <aron.budea@collabora.com>2017-04-06 18:10:12 +0000
commitc9ba32d13aa3076e43596b3b0ad95b5e4eac4d27 (patch)
tree4278664e299f6f05d7c17704f4fbfcd29292c009 /include/vcl/menu.hxx
parent9a6aa402dcfd38194f0d9c661692ffefc0ba7357 (diff)
tdf#104686: do not crash if Menu has been somehow disposed
The rare crashes in MenuFloatingWindow::ImplGetStartY() and MenuFloatingWindow::ImplScroll(bool) likely happen because of a disposed Menu. Let's guard against invalid accesses. Change-Id: Ie31240abbc48c06edd40d0a95f319725cdb3db16 Reviewed-on: https://gerrit.libreoffice.org/36026 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/36151 Reviewed-by: Aron Budea <aron.budea@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/36228 Tested-by: Aron Budea <aron.budea@collabora.com>
Diffstat (limited to 'include/vcl/menu.hxx')
-rw-r--r--include/vcl/menu.hxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/vcl/menu.hxx b/include/vcl/menu.hxx
index 14c3356f0900..53d35b219761 100644
--- a/include/vcl/menu.hxx
+++ b/include/vcl/menu.hxx
@@ -131,7 +131,7 @@ class VCL_DLLPUBLIC Menu : public Resource
friend struct ImplMenuDelData;
private:
ImplMenuDelData* mpFirstDel;
- MenuItemList* pItemList; // Liste mit den MenuItems
+ std::unique_ptr<MenuItemList> pItemList; // list with MenuItems
MenuLogo* pLogo;
Menu* pStartedFrom;
VclPtr<vcl::Window> pWindow;
@@ -369,7 +369,7 @@ public:
// Fuer Menu-'Funktionen'
MenuItemList* GetItemList() const
{
- return pItemList;
+ return pItemList.get();
}
// returns the system's menu handle if native menus are supported