summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cui/source/dialogs/iconcdlg.cxx2
-rw-r--r--cui/source/factory/dlgfact.hxx2
-rw-r--r--cui/source/options/treeopt.cxx2
-rw-r--r--dbaccess/source/ui/querydesign/JoinTableView.cxx4
-rw-r--r--dbaccess/source/ui/querydesign/QueryTabConnUndoAction.cxx1
-rw-r--r--dbaccess/source/ui/querydesign/QueryTabWinUndoAct.cxx2
-rw-r--r--desktop/source/deployment/gui/dp_gui_theextmgr.cxx2
-rw-r--r--extensions/source/propctrlr/propertyeditor.hxx2
-rw-r--r--forms/source/solar/inc/navtoolbar.hxx2
-rw-r--r--fpicker/source/office/commonpicker.cxx6
-rw-r--r--framework/inc/classes/fwktabwindow.hxx2
-rw-r--r--include/sfx2/fcontnr.hxx2
-rw-r--r--sc/source/ui/attrdlg/scdlgfact.hxx6
-rw-r--r--sc/source/ui/drawfunc/fupoor.cxx1
-rw-r--r--sd/source/ui/dlg/sddlgfact.hxx2
-rw-r--r--sd/source/ui/func/fupoor.cxx3
-rw-r--r--sfx2/source/control/thumbnailviewitem.cxx1
-rw-r--r--sfx2/source/dialog/basedlgs.cxx2
-rw-r--r--sfx2/source/dialog/infobar.cxx9
-rw-r--r--sfx2/source/dialog/templdlg.cxx1
-rw-r--r--svtools/source/control/tabbar.cxx24
-rw-r--r--svtools/source/dialogs/roadmapwizard.cxx2
-rw-r--r--svx/source/fmcomp/gridcell.cxx4
-rw-r--r--svx/source/form/datanavi.cxx3
-rw-r--r--sw/source/ui/dbui/createaddresslistdialog.cxx8
-rw-r--r--sw/source/ui/dbui/mmaddressblockpage.cxx7
-rw-r--r--sw/source/ui/dialog/swdlgfact.cxx1
-rw-r--r--sw/source/ui/dialog/swdlgfact.hxx2
-rw-r--r--sw/source/ui/index/cnttab.cxx2
-rw-r--r--sw/source/uibase/docvw/PostItMgr.cxx3
-rw-r--r--sw/source/uibase/uiview/pview.cxx6
-rw-r--r--sw/source/uibase/utlui/navipi.cxx1
-rw-r--r--vcl/source/control/tabctrl.cxx2
-rw-r--r--vcl/source/edit/vclmedit.cxx9
-rw-r--r--vcl/source/gdi/print3.cxx1
-rw-r--r--vcl/source/window/btndlg.cxx6
-rw-r--r--vcl/source/window/builder.cxx1
-rw-r--r--vcl/unx/generic/app/i18n_status.cxx1
38 files changed, 99 insertions, 38 deletions
diff --git a/cui/source/dialogs/iconcdlg.cxx b/cui/source/dialogs/iconcdlg.cxx
index cb809619e0f7..4e0c09b1474b 100644
--- a/cui/source/dialogs/iconcdlg.cxx
+++ b/cui/source/dialogs/iconcdlg.cxx
@@ -242,7 +242,7 @@ void IconChoiceDialog::dispose()
if ( pData->bOnDemand )
delete &pData->pPage->GetItemSet();
- delete pData->pPage;
+ pData->pPage.disposeAndClear();
}
delete pData;
}
diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx
index 98833f9a70be..808a80c96fa5 100644
--- a/cui/source/factory/dlgfact.hxx
+++ b/cui/source/factory/dlgfact.hxx
@@ -81,7 +81,7 @@ short Class::Execute() \
class VclAbstractDialog2_Impl : public VclAbstractDialog2
{
- VclPtr<Dialog> m_pDlg;
+ ScopedVclPtr<Dialog> m_pDlg;
Link m_aEndDlgHdl;
public:
VclAbstractDialog2_Impl( Dialog* p ) : m_pDlg( p ) {}
diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx
index 6262d24f2f9e..ab31348d2479 100644
--- a/cui/source/options/treeopt.cxx
+++ b/cui/source/options/treeopt.cxx
@@ -465,7 +465,7 @@ static bool lcl_isOptionHidden( sal_uInt16 _nPageId, const SvtOptionsDialogOptio
struct OptionsPageInfo
{
- VclPtr<SfxTabPage> m_pPage;
+ ScopedVclPtr<SfxTabPage> m_pPage;
sal_uInt16 m_nPageId;
OUString m_sPageURL;
OUString m_sEventHdl;
diff --git a/dbaccess/source/ui/querydesign/JoinTableView.cxx b/dbaccess/source/ui/querydesign/JoinTableView.cxx
index 2125cbd7fa1e..da52057aee5d 100644
--- a/dbaccess/source/ui/querydesign/JoinTableView.cxx
+++ b/dbaccess/source/ui/querydesign/JoinTableView.cxx
@@ -1535,6 +1535,10 @@ void OJoinTableView::clearLayoutInformation()
m_aTableMap.clear();
+ for(auto i = m_vTableConnection.begin();
+ i != m_vTableConnection.end(); ++i)
+ i->disposeAndClear();
+
m_vTableConnection.clear();
}
diff --git a/dbaccess/source/ui/querydesign/QueryTabConnUndoAction.cxx b/dbaccess/source/ui/querydesign/QueryTabConnUndoAction.cxx
index 85f3ff283985..02c59c3cb998 100644
--- a/dbaccess/source/ui/querydesign/QueryTabConnUndoAction.cxx
+++ b/dbaccess/source/ui/querydesign/QueryTabConnUndoAction.cxx
@@ -33,6 +33,7 @@ OQueryTabConnUndoAction::~OQueryTabConnUndoAction()
if (m_bOwnerOfConn)
{ // I have the connection -> delete
m_pOwner->DeselectConn(m_pConnection);
+ m_pConnection.disposeAndClear();
}
}
diff --git a/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.cxx b/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.cxx
index 1745890f1145..d898780b9d48 100644
--- a/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.cxx
+++ b/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.cxx
@@ -56,6 +56,7 @@ OQueryTabWinUndoAct::~OQueryTabWinUndoAct()
if ( m_pTabWin )
m_pTabWin->clearListBox();
+ m_pTabWin.disposeAndClear();
// and of course the corresponding connections
auto aIter = m_vTableConnection.begin();
@@ -63,6 +64,7 @@ OQueryTabWinUndoAct::~OQueryTabWinUndoAct()
for(;aIter != aEnd;++aIter)
{
m_pOwner->DeselectConn(*aIter);
+ aIter->disposeAndClear();
}
m_vTableConnection.clear();
}
diff --git a/desktop/source/deployment/gui/dp_gui_theextmgr.cxx b/desktop/source/deployment/gui/dp_gui_theextmgr.cxx
index a031b476ac97..53b5380f9cc8 100644
--- a/desktop/source/deployment/gui/dp_gui_theextmgr.cxx
+++ b/desktop/source/deployment/gui/dp_gui_theextmgr.cxx
@@ -98,6 +98,8 @@ TheExtensionManager::TheExtensionManager( vcl::Window *pParent,
TheExtensionManager::~TheExtensionManager()
{
+ m_pUpdReqDialog.disposeAndClear();
+ m_pExtMgrDialog.disposeAndClear();
delete m_pExecuteCmdQueue;
}
diff --git a/extensions/source/propctrlr/propertyeditor.hxx b/extensions/source/propctrlr/propertyeditor.hxx
index a43ee8ded711..2e2d6fde8752 100644
--- a/extensions/source/propctrlr/propertyeditor.hxx
+++ b/extensions/source/propctrlr/propertyeditor.hxx
@@ -49,7 +49,7 @@ namespace pcr
struct HiddenPage
{
sal_uInt16 nPos;
- VclPtr<TabPage> pPage;
+ ScopedVclPtr<TabPage> pPage;
HiddenPage() : nPos( 0 ), pPage( NULL ) { }
HiddenPage( sal_uInt16 _nPos, TabPage* _pPage ) : nPos( _nPos ), pPage( _pPage ) { }
};
diff --git a/forms/source/solar/inc/navtoolbar.hxx b/forms/source/solar/inc/navtoolbar.hxx
index e5c26272707e..ec66f92f78a9 100644
--- a/forms/source/solar/inc/navtoolbar.hxx
+++ b/forms/source/solar/inc/navtoolbar.hxx
@@ -61,7 +61,7 @@ namespace frm
m_pDescriptionProvider;
ImageSize m_eImageSize;
VclPtr<ImplNavToolBar> m_pToolbar;
- ::std::vector< VclPtr<vcl::Window> > m_aChildWins;
+ ::std::vector< ScopedVclPtr<vcl::Window> > m_aChildWins;
public:
NavigationToolBar(
diff --git a/fpicker/source/office/commonpicker.cxx b/fpicker/source/office/commonpicker.cxx
index 95ee24b14db8..f23756858a43 100644
--- a/fpicker/source/office/commonpicker.cxx
+++ b/fpicker/source/office/commonpicker.cxx
@@ -148,7 +148,11 @@ namespace svt
{
stopWindowListening();
- m_pDlg.clear();
+ if ( !bDialogDying ) // it's the parent which is dying -> delete the dialog
+ m_pDlg.disposeAndClear();
+ else
+ m_pDlg.clear();
+
m_xWindow = NULL;
m_xDialogParent = NULL;
}
diff --git a/framework/inc/classes/fwktabwindow.hxx b/framework/inc/classes/fwktabwindow.hxx
index b0414824ed57..ed3d82c80e2c 100644
--- a/framework/inc/classes/fwktabwindow.hxx
+++ b/framework/inc/classes/fwktabwindow.hxx
@@ -78,7 +78,7 @@ public:
struct TabEntry
{
sal_Int32 m_nIndex;
- VclPtr<FwkTabPage> m_pPage;
+ ScopedVclPtr<FwkTabPage> m_pPage;
OUString m_sPageURL;
css::uno::Reference< css::awt::XContainerWindowEventHandler > m_xEventHdl;
diff --git a/include/sfx2/fcontnr.hxx b/include/sfx2/fcontnr.hxx
index 3ae423726ca0..1c325b92f628 100644
--- a/include/sfx2/fcontnr.hxx
+++ b/include/sfx2/fcontnr.hxx
@@ -57,7 +57,7 @@ public:
class SfxFrameWindow
{
- VclPtr<vcl::Window> pWindow;
+ ScopedVclPtr<vcl::Window> pWindow;
public:
SfxFrameWindow( vcl::Window *pWin )
: pWindow( pWin )
diff --git a/sc/source/ui/attrdlg/scdlgfact.hxx b/sc/source/ui/attrdlg/scdlgfact.hxx
index 44f6969e0c2e..216c3c8a8211 100644
--- a/sc/source/ui/attrdlg/scdlgfact.hxx
+++ b/sc/source/ui/attrdlg/scdlgfact.hxx
@@ -58,7 +58,7 @@ class ScTextImportOptionsDlg;
class ScCondFormatManagerDlg;
#define DECL_ABSTDLG_BASE(Class,DialogClass) \
- VclPtr<DialogClass> pDlg; \
+ ScopedVclPtr<DialogClass> pDlg; \
public: \
Class( DialogClass* p) \
: pDlg(p) \
@@ -66,8 +66,8 @@ public: \
virtual ~Class(); \
virtual short Execute() SAL_OVERRIDE ;
-#define DECL_ABSTDLG2_BASE(Class,DialogClass) \
- VclPtr<DialogClass> pDlg; \
+#define DECL_ABSTDLG2_BASE(Class,DialogClass) \
+ ScopedVclPtr<DialogClass> pDlg; \
public: \
Class( DialogClass* p) \
: pDlg(p) \
diff --git a/sc/source/ui/drawfunc/fupoor.cxx b/sc/source/ui/drawfunc/fupoor.cxx
index 28bf18ebf214..f0aa72a5caca 100644
--- a/sc/source/ui/drawfunc/fupoor.cxx
+++ b/sc/source/ui/drawfunc/fupoor.cxx
@@ -53,6 +53,7 @@ FuPoor::~FuPoor()
{
aDragTimer.Stop();
aScrollTimer.Stop();
+ pDialog.disposeAndClear();
}
void FuPoor::Activate()
diff --git a/sd/source/ui/dlg/sddlgfact.hxx b/sd/source/ui/dlg/sddlgfact.hxx
index b7fe5347e91a..3ba9b486d787 100644
--- a/sd/source/ui/dlg/sddlgfact.hxx
+++ b/sd/source/ui/dlg/sddlgfact.hxx
@@ -23,7 +23,7 @@
#include <sfx2/basedlgs.hxx>
#define DECL_ABSTDLG_BASE(Class,DialogClass) \
- VclPtr<DialogClass> pDlg; \
+ ScopedVclPtr<DialogClass> pDlg; \
public: \
Class( DialogClass* p) \
: pDlg(p) \
diff --git a/sd/source/ui/func/fupoor.cxx b/sd/source/ui/func/fupoor.cxx
index f3d94ef85579..9d1da08682a6 100644
--- a/sd/source/ui/func/fupoor.cxx
+++ b/sd/source/ui/func/fupoor.cxx
@@ -100,7 +100,8 @@ FuPoor::~FuPoor()
{
aDragTimer.Stop();
aScrollTimer.Stop();
- aDelayToScrollTimer.Stop ();
+ aDelayToScrollTimer.Stop();
+ pDialog.disposeAndClear();
}
void FuPoor::Activate()
diff --git a/sfx2/source/control/thumbnailviewitem.cxx b/sfx2/source/control/thumbnailviewitem.cxx
index 4d265d75d311..ccaebb12107a 100644
--- a/sfx2/source/control/thumbnailviewitem.cxx
+++ b/sfx2/source/control/thumbnailviewitem.cxx
@@ -117,6 +117,7 @@ ThumbnailViewItem::ThumbnailViewItem(ThumbnailView &rView, sal_uInt16 nId)
ThumbnailViewItem::~ThumbnailViewItem()
{
+ mpTitleED.disposeAndClear();
if( mpxAcc )
{
static_cast< ThumbnailViewItemAcc* >( mpxAcc->get() )->ParentDestroyed();
diff --git a/sfx2/source/dialog/basedlgs.cxx b/sfx2/source/dialog/basedlgs.cxx
index 6a6e4b597090..285e618b398f 100644
--- a/sfx2/source/dialog/basedlgs.cxx
+++ b/sfx2/source/dialog/basedlgs.cxx
@@ -712,6 +712,8 @@ SfxSingleTabDialog::~SfxSingleTabDialog()
void SfxSingleTabDialog::dispose()
{
+ pImpl->m_pSfxPage.disposeAndClear();
+ pImpl->m_pLine.disposeAndClear();
delete pImpl;
pOKBtn.clear();
pCancelBtn.clear();
diff --git a/sfx2/source/dialog/infobar.cxx b/sfx2/source/dialog/infobar.cxx
index 88377b3d0a56..2b1177a723d0 100644
--- a/sfx2/source/dialog/infobar.cxx
+++ b/sfx2/source/dialog/infobar.cxx
@@ -150,8 +150,11 @@ SfxInfoBarWindow::~SfxInfoBarWindow()
void SfxInfoBarWindow::dispose()
{
- m_pMessage.clear();
- m_pCloseBtn.clear();
+ for ( auto it = m_aActionBtns.begin( ); it != m_aActionBtns.end( ); ++it )
+ it->disposeAndClear();
+
+ m_pMessage.disposeAndClear();
+ m_pCloseBtn.disposeAndClear();
m_aActionBtns.clear( );
vcl::Window::dispose();
}
@@ -247,6 +250,8 @@ SfxInfoBarContainerWindow::~SfxInfoBarContainerWindow()
void SfxInfoBarContainerWindow::dispose()
{
+ for ( auto it = m_pInfoBars.begin( ); it != m_pInfoBars.end( ); ++it )
+ it->disposeAndClear();
m_pInfoBars.clear( );
Window::dispose();
}
diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
index b1c8bf013b0d..cbe8217dd03e 100644
--- a/sfx2/source/dialog/templdlg.cxx
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -765,6 +765,7 @@ SfxCommonTemplateDialog_Impl::~SfxCommonTemplateDialog_Impl()
if ( pStyleSheetPool )
EndListening(*pStyleSheetPool);
pStyleSheetPool = NULL;
+ pTreeBox.disposeAndClear();
delete pIdle;
if ( m_pDeletionWatcher )
m_pDeletionWatcher->signal();
diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx
index 2df93f16defe..9ff0df667646 100644
--- a/svtools/source/control/tabbar.cxx
+++ b/svtools/source/control/tabbar.cxx
@@ -328,13 +328,13 @@ IMPL_LINK_NOARG(TabBarEdit, ImplEndTimerHdl)
struct TabBar_Impl
{
- VclPtr<ImplTabSizer> mpSizer;
- VclPtr<ImplTabButton> mpFirstButton;
- VclPtr<ImplTabButton> mpPrevButton;
- VclPtr<ImplTabButton> mpNextButton;
- VclPtr<ImplTabButton> mpLastButton;
- VclPtr<TabBarEdit> mpEdit;
- ImplTabBarList mpItemList;
+ ScopedVclPtr<ImplTabSizer> mpSizer;
+ ScopedVclPtr<ImplTabButton> mpFirstButton;
+ ScopedVclPtr<ImplTabButton> mpPrevButton;
+ ScopedVclPtr<ImplTabButton> mpNextButton;
+ ScopedVclPtr<ImplTabButton> mpLastButton;
+ ScopedVclPtr<TabBarEdit> mpEdit;
+ ImplTabBarList mpItemList;
svt::AccessibleFactoryAccess maAccessibleFactory;
@@ -347,22 +347,12 @@ struct TabBar_Impl
delete mpItemList[i];
}
mpItemList.clear();
-
- mpPrevBtn.disposeAndClear();
- mpNextBtn.disposeAndClear();
- mpFirstBtn.disposeAndClear();
- mpLastBtn.disposeAndClear();
- mpEdit.disposeAndClear();
}
sal_uInt16 getItemSize()
{
return static_cast<sal_uInt16>(mpItemList.size());
}
- ~TabBar_Impl()
- {
- mpSizer.disposeAndClear();
- }
};
TabBar::TabBar( vcl::Window* pParent, WinBits nWinStyle ) :
diff --git a/svtools/source/dialogs/roadmapwizard.cxx b/svtools/source/dialogs/roadmapwizard.cxx
index 411c9b06b582..87c63f0384d7 100644
--- a/svtools/source/dialogs/roadmapwizard.cxx
+++ b/svtools/source/dialogs/roadmapwizard.cxx
@@ -55,7 +55,7 @@ namespace svt
struct RoadmapWizardImpl : public RoadmapWizardTypes
{
- VclPtr<ORoadmap> pRoadmap;
+ ScopedVclPtr<ORoadmap> pRoadmap;
Paths aPaths;
PathId nActivePath;
StateDescriptions aStateDescriptors;
diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx
index 66984dbc86af..403fa39db273 100644
--- a/svx/source/fmcomp/gridcell.cxx
+++ b/svx/source/fmcomp/gridcell.cxx
@@ -643,8 +643,10 @@ DbCellControl::~DbCellControl()
{
lcl_clearBroadCaster(m_pModelChangeBroadcaster);
lcl_clearBroadCaster(m_pFieldChangeBroadcaster);
-}
+ m_pWindow.disposeAndClear();
+ m_pPainter.disposeAndClear();
+}
void DbCellControl::implValuePropertyChanged( )
{
diff --git a/svx/source/form/datanavi.cxx b/svx/source/form/datanavi.cxx
index 349da44fa983..3460eca90a89 100644
--- a/svx/source/form/datanavi.cxx
+++ b/svx/source/form/datanavi.cxx
@@ -1436,6 +1436,9 @@ namespace svxform
m_pSubmissionPage.clear();
m_pBindingPage.clear();
+ sal_Int32 i, nCount = m_aPageList.size();
+ for ( i = 0; i < nCount; ++i )
+ m_aPageList[i].disposeAndClear();
m_aPageList.clear();
Reference< XFrameActionListener > xListener(
diff --git a/sw/source/ui/dbui/createaddresslistdialog.cxx b/sw/source/ui/dbui/createaddresslistdialog.cxx
index 16cd697c82d0..5f7a6fde5281 100644
--- a/sw/source/ui/dbui/createaddresslistdialog.cxx
+++ b/sw/source/ui/dbui/createaddresslistdialog.cxx
@@ -119,7 +119,11 @@ SwAddressControl_Impl::~SwAddressControl_Impl()
void SwAddressControl_Impl::dispose()
{
+ for(auto aTextIter = m_aFixedTexts.begin(); aTextIter != m_aFixedTexts.end(); ++aTextIter)
+ aTextIter->disposeAndClear();
m_aFixedTexts.clear();
+ for(auto aEditIter = m_aEdits.begin(); aEditIter != m_aEdits.end(); ++aEditIter)
+ aEditIter->disposeAndClear();
m_aEdits.clear();
m_pScrollBar.clear();
m_pWindow.clear();
@@ -132,7 +136,11 @@ void SwAddressControl_Impl::SetData(SwCSVData& rDBData)
//when the address data is updated then remove the controls an build again
if(m_aFixedTexts.size())
{
+ for(auto aTextIter = m_aFixedTexts.begin(); aTextIter != m_aFixedTexts.end(); ++aTextIter)
+ aTextIter->disposeAndClear();
m_aFixedTexts.clear();
+ for(auto aEditIter = m_aEdits.begin(); aEditIter != m_aEdits.end(); ++aEditIter)
+ aEditIter->disposeAndClear();
m_aEdits.clear();
m_bNoDataSet = true;
}
diff --git a/sw/source/ui/dbui/mmaddressblockpage.cxx b/sw/source/ui/dbui/mmaddressblockpage.cxx
index 538163d4a003..42b9e33118be 100644
--- a/sw/source/ui/dbui/mmaddressblockpage.cxx
+++ b/sw/source/ui/dbui/mmaddressblockpage.cxx
@@ -989,6 +989,13 @@ SwAssignFieldsControl::~SwAssignFieldsControl()
void SwAssignFieldsControl::dispose()
{
+ for(auto aFIIter = m_aFieldNames.begin(); aFIIter != m_aFieldNames.end(); ++aFIIter)
+ aFIIter->disposeAndClear();
+ for(auto aLBIter = m_aMatches.begin(); aLBIter != m_aMatches.end(); ++aLBIter)
+ aLBIter->disposeAndClear();
+ for(auto aFIIter = m_aPreviews.begin(); aFIIter != m_aPreviews.end(); ++aFIIter)
+ aFIIter->disposeAndClear();
+
m_aFieldNames.clear();
m_aMatches.clear();
m_aPreviews.clear();
diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx
index a65a7cbccb6a..68fa68a05448 100644
--- a/sw/source/ui/dialog/swdlgfact.cxx
+++ b/sw/source/ui/dialog/swdlgfact.cxx
@@ -595,6 +595,7 @@ void AbstractSwWordCountFloatDlg_Impl::SetCounts(const SwDocStat &rCurrCnt, cons
AbstractMailMergeWizard_Impl::~AbstractMailMergeWizard_Impl()
{
+ pDlg.disposeAndClear();
}
void AbstractMailMergeWizard_Impl::StartExecuteModal( const Link& rEndDialogHdl )
diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx
index ea38f7156601..4ec9fa68ad33 100644
--- a/sw/source/ui/dialog/swdlgfact.hxx
+++ b/sw/source/ui/dialog/swdlgfact.hxx
@@ -48,7 +48,7 @@ class DropDownFieldDialog;
#define DECL_ABSTDLG_BASE(Class,DialogClass) \
protected: \
- VclPtr<DialogClass> pDlg; \
+ ScopedVclPtr<DialogClass> pDlg; \
public: \
Class( DialogClass* p) \
: pDlg(p) \
diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index e0fd48353790..e65a90414f75 100644
--- a/sw/source/ui/index/cnttab.cxx
+++ b/sw/source/ui/index/cnttab.cxx
@@ -2789,6 +2789,8 @@ void SwTokenWindow::SetForm(SwForm& rForm, sal_uInt16 nL)
if(pForm)
{
+ for (ctrl_iterator iter = aControlList.begin(); iter != aControlList.end(); ++iter)
+ iter->disposeAndClear();
//apply current level settings to the form
for (auto it = aControlList.begin(); it != aControlList.end(); ++it)
it->disposeAndClear();
diff --git a/sw/source/uibase/docvw/PostItMgr.cxx b/sw/source/uibase/docvw/PostItMgr.cxx
index b16c1c6d41b6..6f2404afd521 100644
--- a/sw/source/uibase/docvw/PostItMgr.cxx
+++ b/sw/source/uibase/docvw/PostItMgr.cxx
@@ -193,6 +193,7 @@ void SwPostItMgr::CheckForRemovedPostIts()
mvPostItFlds.remove(*it);
if (GetActiveSidebarWin() == p->pPostIt)
SetActiveSidebarWin(0);
+ p->pPostIt.disposeAndClear();
delete p;
bRemoved = true;
}
@@ -241,6 +242,7 @@ void SwPostItMgr::RemoveItem( SfxBroadcaster* pBroadcast )
SwSidebarItem* p = (*i);
if (GetActiveSidebarWin() == p->pPostIt)
SetActiveSidebarWin(0);
+ p->pPostIt.disposeAndClear();
mvPostItFlds.erase(i);
delete p;
break;
@@ -1174,6 +1176,7 @@ void SwPostItMgr::RemoveSidebarWin()
for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i != mvPostItFlds.end() ; ++i)
{
EndListening( *(const_cast<SfxBroadcaster*>((*i)->GetBroadCaster())) );
+ (*i)->pPostIt.disposeAndClear();
delete (*i);
}
mvPostItFlds.clear();
diff --git a/sw/source/uibase/uiview/pview.cxx b/sw/source/uibase/uiview/pview.cxx
index 9e2f997a2ec0..ad29cdc9bb9c 100644
--- a/sw/source/uibase/uiview/pview.cxx
+++ b/sw/source/uibase/uiview/pview.cxx
@@ -1238,6 +1238,12 @@ SwPagePreview::~SwPagePreview()
SwViewShell* pVShell = pViewWin->GetViewShell();
pVShell->SetWin(0);
delete pVShell;
+
+ pViewWin.disposeAndClear();
+
+ pScrollFill.disposeAndClear();
+ pHScrollbar.disposeAndClear();
+ pVScrollbar.disposeAndClear();
}
SwDocShell* SwPagePreview::GetDocShell()
diff --git a/sw/source/uibase/utlui/navipi.cxx b/sw/source/uibase/utlui/navipi.cxx
index f5161a7871d7..fb057fc7067c 100644
--- a/sw/source/uibase/utlui/navipi.cxx
+++ b/sw/source/uibase/utlui/navipi.cxx
@@ -895,6 +895,7 @@ IMPL_LINK_NOARG(SwNavigationPI, PopupModeEndHdl)
{
// Replace floating window with popup window and destroy
// floating window instance.
+ pFloatingWindow.disposeAndClear();
pFloatingWindow = pPopupWindow;
pPopupWindow = 0;
}
diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx
index 961dd919f760..90184ecd7ec4 100644
--- a/vcl/source/control/tabctrl.cxx
+++ b/vcl/source/control/tabctrl.cxx
@@ -204,6 +204,8 @@ void TabControl::dispose()
ImplFreeLayoutData();
// delete TabCtrl data
+ if (mpTabCtrlData)
+ mpTabCtrlData->mpListBox.disposeAndClear();
delete mpTabCtrlData;
mpTabCtrlData = NULL;
Control::dispose();
diff --git a/vcl/source/edit/vclmedit.cxx b/vcl/source/edit/vclmedit.cxx
index 4322248fad75..6371297691dc 100644
--- a/vcl/source/edit/vclmedit.cxx
+++ b/vcl/source/edit/vclmedit.cxx
@@ -184,6 +184,7 @@ void ImpVclMEdit::ImpUpdateSrollBarVis( WinBits nWinStyle )
bool bScrollbarsChanged = false;
if ( bHaveVScroll != bNeedVScroll )
{
+ mpVScrollBar.disposeAndClear();
mpVScrollBar = bNeedVScroll ? new ScrollBar( pVclMultiLineEdit, WB_VSCROLL|WB_DRAG ) : NULL;
if ( bNeedVScroll )
@@ -197,6 +198,7 @@ void ImpVclMEdit::ImpUpdateSrollBarVis( WinBits nWinStyle )
if ( bHaveHScroll != bNeedHScroll )
{
+ mpHScrollBar.disposeAndClear();
mpHScrollBar = bNeedHScroll ? new ScrollBar( pVclMultiLineEdit, WB_HSCROLL|WB_DRAG ) : NULL;
if ( bNeedHScroll )
@@ -210,6 +212,7 @@ void ImpVclMEdit::ImpUpdateSrollBarVis( WinBits nWinStyle )
if ( bHaveScrollBox != bNeedScrollBox )
{
+ mpScrollBox.disposeAndClear();
mpScrollBox = bNeedScrollBox ? new ScrollBarBox( pVclMultiLineEdit, WB_SIZEABLE ) : NULL;
if ( bNeedScrollBox )
@@ -255,10 +258,10 @@ void ImpVclMEdit::InitFromStyle( WinBits nWinStyle )
ImpVclMEdit::~ImpVclMEdit()
{
EndListening( *mpTextWindow->GetTextEngine() );
- mpScrollBox.disposeAndClear();
- mpVScrollBar.disposeAndClear();
- mpHScrollBar.disposeAndClear();
mpTextWindow.disposeAndClear();
+ mpHScrollBar.disposeAndClear();
+ mpVScrollBar.disposeAndClear();
+ mpScrollBox.disposeAndClear();
pVclMultiLineEdit.disposeAndClear();
}
diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx
index 8216e6e1e7d4..b5e78453ea4c 100644
--- a/vcl/source/gdi/print3.cxx
+++ b/vcl/source/gdi/print3.cxx
@@ -191,6 +191,7 @@ public:
mnDefaultPaperBin( -1 ),
mnFixedPaperBin( -1 )
{}
+ ~ImplPrinterControllerData() { mpProgress.disposeAndClear(); }
Size getRealPaperSize( const Size& i_rPageSize, bool bNoNUP ) const
{
diff --git a/vcl/source/window/btndlg.cxx b/vcl/source/window/btndlg.cxx
index 37a4b3a5a856..b0552fff1e69 100644
--- a/vcl/source/window/btndlg.cxx
+++ b/vcl/source/window/btndlg.cxx
@@ -64,6 +64,11 @@ ButtonDialog::~ButtonDialog()
void ButtonDialog::dispose()
{
+ for ( btn_iterator it = maItemList.begin(); it != maItemList.end(); ++it)
+ {
+ if ( it->mbOwnButton )
+ it->mpPushButton.disposeAndClear();
+ }
maItemList.clear();
Dialog::dispose();
}
@@ -343,6 +348,7 @@ void ButtonDialog::Clear()
for (btn_iterator it = maItemList.begin(); it != maItemList.end(); ++it)
{
it->mpPushButton->Hide();
+ it->mpPushButton.disposeAndClear();
}
maItemList.clear();
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index 92595d061c33..7a4bd3d2b917 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -3286,6 +3286,7 @@ void VclBuilder::delete_by_name(const OString& sID)
{
if (aI->m_sID.equals(sID))
{
+ aI->m_pWindow.disposeAndClear();
m_aChildren.erase(aI);
break;
}
diff --git a/vcl/unx/generic/app/i18n_status.cxx b/vcl/unx/generic/app/i18n_status.cxx
index 210171363843..13cfdb1b911b 100644
--- a/vcl/unx/generic/app/i18n_status.cxx
+++ b/vcl/unx/generic/app/i18n_status.cxx
@@ -523,6 +523,7 @@ I18NStatus::I18NStatus() :
I18NStatus::~I18NStatus()
{
+ m_pStatusWindow.disposeAndClear();
if( pInstance == this )
pInstance = NULL;
}