summaryrefslogtreecommitdiff
path: root/include/framework
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-06-20 15:56:35 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-06-23 06:28:00 +0000
commitaa0d0536a444fb26d9e570bd6bf6c1bdc3596cf3 (patch)
tree8b2a5207e77fa4054a37b33c25378c23a00af8ed /include/framework
parentb722f3d6fc72877e8caaaae7291d5d736ddc494d (diff)
tdf#97527 - vcl: reference-count Menu
some places are marked with "dodgy"- need to check those to see what is going on, because they are leaving dangling pointers behind in the Menu class Change-Id: I41d5c7c0fec2f70ce9e3ffdc48cd03d26c0a869b Reviewed-on: https://gerrit.libreoffice.org/26516 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'include/framework')
-rw-r--r--include/framework/addonmenu.hxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/include/framework/addonmenu.hxx b/include/framework/addonmenu.hxx
index b909d61099e8..fec0de71b894 100644
--- a/include/framework/addonmenu.hxx
+++ b/include/framework/addonmenu.hxx
@@ -39,6 +39,7 @@ class FWE_DLLPUBLIC AddonMenu : public PopupMenu
public:
AddonMenu( const css::uno::Reference< css::frame::XFrame >& rFrame );
virtual ~AddonMenu();
+ virtual void dispose() override;
protected:
css::uno::Reference< css::frame::XFrame > m_xFrame;
@@ -62,6 +63,7 @@ class FWE_DLLPUBLIC AddonPopupMenu : public AddonMenu
OUString m_aCommandURL;
friend class AddonMenuManager;
+ friend class ::VclPtr<AddonPopupMenu>;
};
class FWE_DLLPUBLIC AddonMenuManager
@@ -81,10 +83,10 @@ class FWE_DLLPUBLIC AddonMenuManager
static bool IsCorrectContext(const OUString& rModuleIdentifier, const OUString& rContext);
// Factory method to create different Add-On menu types
- static PopupMenu* CreatePopupMenuType( MenuType eMenuType, const css::uno::Reference< css::frame::XFrame >& rFrame );
+ static VclPtr<PopupMenu> CreatePopupMenuType( MenuType eMenuType, const css::uno::Reference< css::frame::XFrame >& rFrame );
// Create the Add-Ons menu
- static AddonMenu* CreateAddonMenu( const css::uno::Reference< css::frame::XFrame >& rFrame,
+ static VclPtr<AddonMenu> CreateAddonMenu( const css::uno::Reference< css::frame::XFrame >& rFrame,
const css::uno::Reference< css::uno::XComponentContext >& rContext );
// Merge the Add-Ons help menu items into the given menu bar at a defined pos