From aa0d0536a444fb26d9e570bd6bf6c1bdc3596cf3 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 20 Jun 2016 15:56:35 +0200 Subject: 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 Reviewed-by: Noel Grandin --- fpicker/source/office/RemoteFilesDialog.hxx | 2 +- fpicker/source/office/iodlgimp.cxx | 4 ++-- fpicker/source/office/iodlgimp.hxx | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'fpicker') diff --git a/fpicker/source/office/RemoteFilesDialog.hxx b/fpicker/source/office/RemoteFilesDialog.hxx index a2a7d16fb0c5..84ba1e76e065 100644 --- a/fpicker/source/office/RemoteFilesDialog.hxx +++ b/fpicker/source/office/RemoteFilesDialog.hxx @@ -162,7 +162,7 @@ private: VclPtr< FileViewContainer > m_pContainer; VclPtr< ListBox > m_pFilter_lb; VclPtr< AutocompleteEdit > m_pName_ed; - PopupMenu* m_pAddMenu; + VclPtr m_pAddMenu; ImageList m_aImages; diff --git a/fpicker/source/office/iodlgimp.cxx b/fpicker/source/office/iodlgimp.cxx index 7aaa3d05bd2e..9cee811117a2 100644 --- a/fpicker/source/office/iodlgimp.cxx +++ b/fpicker/source/office/iodlgimp.cxx @@ -91,7 +91,7 @@ SvtFileDialogFilter_Impl::~SvtFileDialogFilter_Impl() SvtFileDialogURLSelector::SvtFileDialogURLSelector( vcl::Window* _pParent, SvtFileDialog* _pDlg, WinBits nBits, sal_uInt16 _nButtonId ) :MenuButton ( _pParent, nBits ) ,m_pDlg ( _pDlg ) - ,m_pMenu ( new PopupMenu ) + ,m_pMenu ( VclPtr::Create() ) { SetStyle( GetStyle() | WB_NOPOINTERFOCUS | WB_RECTSTYLE | WB_SMALLSTYLE ); SetModeImage( _pDlg->GetButtonImage( _nButtonId ) ); @@ -107,7 +107,7 @@ SvtFileDialogURLSelector::~SvtFileDialogURLSelector() void SvtFileDialogURLSelector::dispose() { - delete m_pMenu; + m_pMenu.disposeAndClear(); m_pDlg.clear(); MenuButton::dispose(); } diff --git a/fpicker/source/office/iodlgimp.hxx b/fpicker/source/office/iodlgimp.hxx index 1726a394a542..7ad944300e56 100644 --- a/fpicker/source/office/iodlgimp.hxx +++ b/fpicker/source/office/iodlgimp.hxx @@ -84,7 +84,7 @@ public: virtual void dispose() override; private: VclPtr m_pDlg; - PopupMenu* m_pMenu; + VclPtr m_pMenu; protected: inline SvtFileDialog* GetDialogParent() { return m_pDlg; } -- cgit