summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2015-03-17 20:19:40 +0000
committerMichael Meeks <michael.meeks@collabora.com>2015-04-10 11:51:01 +0100
commit256371f49dad16347db48d7ff826779345538f3c (patch)
tree3d3ab224e8434c16f95c4670ed5bc34a4e9f05f3
parenta140e0d0bab3bd09fe19711fc99e411fcc2675d7 (diff)
clear() is the equivalent of assigning a local ptr to NULL.
Sometimes it matters; doing a disposeAndClear() instead can change the order of destruction profoundly. Fix a number of issues from: "vclwidget: change all vcl::window fields to be wrapped in VclPtr" Change-Id: I3127d3ed973458e8299156453258e167dbdb8ccf
-rw-r--r--avmedia/source/framework/mediacontrol.cxx2
-rw-r--r--basctl/source/basicide/basidesh.cxx6
-rw-r--r--cui/source/factory/dlgfact.cxx5
-rw-r--r--cui/source/factory/dlgfact.hxx3
-rw-r--r--sfx2/source/appl/childwin.cxx6
5 files changed, 16 insertions, 6 deletions
diff --git a/avmedia/source/framework/mediacontrol.cxx b/avmedia/source/framework/mediacontrol.cxx
index e6c680e45d3d..baf1acfe8949 100644
--- a/avmedia/source/framework/mediacontrol.cxx
+++ b/avmedia/source/framework/mediacontrol.cxx
@@ -202,7 +202,7 @@ MediaControl::~MediaControl()
void MediaControl::dispose()
{
maZoomToolBox->SetItemWindow( AVMEDIA_TOOLBOXITEM_ZOOM, NULL );
- mpZoomListBox.disposeAndClear();
+ mpZoomListBox.clear();
maTimeEdit.disposeAndClear();
maZoomToolBox.disposeAndClear();
maVolumeSlider.disposeAndClear();
diff --git a/basctl/source/basicide/basidesh.cxx b/basctl/source/basicide/basidesh.cxx
index d161f50f9bc6..58938a2cb837 100644
--- a/basctl/source/basicide/basidesh.cxx
+++ b/basctl/source/basicide/basidesh.cxx
@@ -232,6 +232,12 @@ Shell::~Shell()
SetWindow( 0 );
SetCurWindow( 0 );
+ for (WindowTable::iterator it = aWindowTable.begin(); it != aWindowTable.end(); ++it)
+ {
+ // no store; does already happen when the BasicManagers are destroyed
+ it->second.disposeAndClear();
+ }
+
// no store; does already happen when the BasicManagers are destroyed
aWindowTable.clear();
diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx
index 1210b8afd6df..a540534702ab 100644
--- a/cui/source/factory/dlgfact.cxx
+++ b/cui/source/factory/dlgfact.cxx
@@ -105,9 +105,11 @@ IMPL_ABSTDLG_BASE(AbstractFmShowColsDialog_Impl);
IMPL_ABSTDLG_BASE(AbstractHyphenWordDialog_Impl)
IMPL_ABSTDLG_BASE(AbstractThesaurusDialog_Impl)
-AbstractSvxZoomDialog_Impl::~AbstractSvxZoomDialog_Impl() \
+AbstractSvxZoomDialog_Impl::~AbstractSvxZoomDialog_Impl()
{
+ pDlg.disposeAndClear();
}
+
short AbstractSvxZoomDialog_Impl::Execute()
{
return pDlg->Execute();
@@ -153,6 +155,7 @@ IMPL_ABSTDLG_BASE(AbstractPasswordToOpenModifyDialog_Impl);
// virtual
VclAbstractDialog2_Impl::~VclAbstractDialog2_Impl()
{
+ m_pDlg.disposeAndClear();
}
// virtual
diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx
index d356bbab2181..98833f9a70be 100644
--- a/cui/source/factory/dlgfact.hxx
+++ b/cui/source/factory/dlgfact.hxx
@@ -72,8 +72,9 @@ public: \
#define IMPL_ABSTDLG_BASE(Class) \
Class::~Class() \
{ \
+ pDlg.disposeAndClear(); \
} \
-short Class::Execute() \
+short Class::Execute() \
{ \
return pDlg->Execute(); \
}
diff --git a/sfx2/source/appl/childwin.cxx b/sfx2/source/appl/childwin.cxx
index 1ec9b03fcd02..e1f2ecd40809 100644
--- a/sfx2/source/appl/childwin.cxx
+++ b/sfx2/source/appl/childwin.cxx
@@ -160,7 +160,6 @@ SfxChildWindow::SfxChildWindow(vcl::Window *pParentWindow, sal_uInt16 nId)
: pParent(pParentWindow)
, nType(nId)
, eChildAlignment(SfxChildAlignment::NOALIGNMENT)
- , pWindow(0L)
{
pImp = new SfxChildWindow_Impl;
pImp->pFact = 0L;
@@ -199,6 +198,7 @@ void SfxChildWindow::Destroy()
SfxChildWindow::~SfxChildWindow()
{
delete pContext;
+ pWindow.disposeAndClear();
delete pImp;
}
@@ -510,13 +510,13 @@ void SfxChildWindow::CreateContext( sal_uInt16 nContextId, SfxBindings& rBinding
}
SfxChildWindowContext::SfxChildWindowContext( sal_uInt16 nId )
- : pWindow( NULL )
- , nContextId( nId )
+ : nContextId( nId )
{
}
SfxChildWindowContext::~SfxChildWindowContext()
{
+ pWindow.disposeAndClear();
}
FloatingWindow* SfxChildWindowContext::GetFloatingWindow() const