diff options
author | Aron Budea <aron.budea@collabora.com> | 2017-04-03 02:21:28 +0200 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2017-04-04 15:58:29 +0000 |
commit | 2aa43937ec9c9e22d9b28f4275a5bfb3ffbd82c0 (patch) | |
tree | cd7546ad50324b81a2e09fc878f7ad7ec1c820e8 /include/vcl/menu.hxx | |
parent | c1351a7b1363dac4349f37ac8876fdf950e62b97 (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>
Diffstat (limited to 'include/vcl/menu.hxx')
-rw-r--r-- | include/vcl/menu.hxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/vcl/menu.hxx b/include/vcl/menu.hxx index 3249a3bac25f..4e11b3d2e0da 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; // list with MenuItems + std::unique_ptr<MenuItemList> pItemList; // list with MenuItems MenuLogo* pLogo; VclPtr<Menu> pStartedFrom; VclPtr<vcl::Window> pWindow; @@ -355,7 +355,7 @@ public: // Fuer Menu-'Funktionen' MenuItemList* GetItemList() const { - return pItemList; + return pItemList.get(); } // returns the system's menu handle if native menus are supported |