summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAron Budea <aron.budea@collabora.com>2017-04-03 02:21:28 +0200
committerAndras Timar <andras.timar@collabora.com>2017-04-07 07:53:09 +0200
commitf75be566b13e6361f9792fb227d6cd2b839e1fb6 (patch)
tree87af1b50ff215f018855e75945b37f1db1e438bf /include
parent5ec306f3fb4b8965c4aa0aa14ec09a135471571e (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> (cherry picked from commit 9fcb6cb86893b991ceb6395fbabba63c962f59db)
Diffstat (limited to 'include')
-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 e09289e451d3..a16e5cccffad 100644
--- a/include/vcl/menu.hxx
+++ b/include/vcl/menu.hxx
@@ -133,7 +133,7 @@ class VCL_DLLPUBLIC Menu : public Resource, public VclReferenceBase
friend struct ImplMenuDelData;
private:
ImplMenuDelData* mpFirstDel;
- MenuItemList* pItemList; // Liste mit den MenuItems
+ std::unique_ptr<MenuItemList> pItemList; // list with MenuItems
MenuLogo* pLogo;
VclPtr<Menu> pStartedFrom;
VclPtr<vcl::Window> pWindow;
@@ -359,7 +359,7 @@ public:
// Fuer Menu-'Funktionen'
MenuItemList* GetItemList() const
{
- return pItemList;
+ return pItemList.get();
}
// returns the system's menu handle if native menus are supported