Kaydet (Commit) 256371f4 authored tarafından Michael Meeks's avatar Michael Meeks

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
üst a140e0d0
......@@ -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();
......
......@@ -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();
......
......@@ -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
......
......@@ -72,8 +72,9 @@ public: \
#define IMPL_ABSTDLG_BASE(Class) \
Class::~Class() \
{ \
pDlg.disposeAndClear(); \
} \
short Class::Execute() \
short Class::Execute() \
{ \
return pDlg->Execute(); \
}
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment