Kaydet (Commit) 3c6eec0d authored tarafından Caolán McNamara's avatar Caolán McNamara

Related: tdf#92392 clear workwins that point to pWindow

before trying to destroy pWindow

Change-Id: I7257096e8da2a5d6753ad2091287d63ea9ae244b
üst 8e20a253
...@@ -163,6 +163,8 @@ private: ...@@ -163,6 +163,8 @@ private:
GetContext() const GetContext() const
{ return pContext; } { return pContext; }
SAL_DLLPRIVATE void ClearWorkwin();
protected: protected:
SfxChildWindow(vcl::Window *pParentWindow, sal_uInt16 nId); SfxChildWindow(vcl::Window *pParentWindow, sal_uInt16 nId);
......
...@@ -177,12 +177,7 @@ void SfxChildWindow::Destroy() ...@@ -177,12 +177,7 @@ void SfxChildWindow::Destroy()
{ {
if ( GetFrame().is() ) if ( GetFrame().is() )
{ {
if (pImp->pWorkWin) ClearWorkwin();
{
if (pImp->pWorkWin->GetActiveChild_Impl() == pWindow)
pImp->pWorkWin->SetActiveChild_Impl(NULL);
pImp->pWorkWin = NULL;
}
try try
{ {
::com::sun::star::uno::Reference < ::com::sun::star::util::XCloseable > xClose( GetFrame(), ::com::sun::star::uno::UNO_QUERY ); ::com::sun::star::uno::Reference < ::com::sun::star::util::XCloseable > xClose( GetFrame(), ::com::sun::star::uno::UNO_QUERY );
...@@ -199,11 +194,21 @@ void SfxChildWindow::Destroy() ...@@ -199,11 +194,21 @@ void SfxChildWindow::Destroy()
delete this; delete this;
} }
void SfxChildWindow::ClearWorkwin()
{
if (pImp->pWorkWin)
{
if (pImp->pWorkWin->GetActiveChild_Impl() == pWindow)
pImp->pWorkWin->SetActiveChild_Impl(NULL);
pImp->pWorkWin = NULL;
}
}
SfxChildWindow::~SfxChildWindow() SfxChildWindow::~SfxChildWindow()
{ {
delete pContext; delete pContext;
pContext = NULL; pContext = NULL;
ClearWorkwin();
pWindow.disposeAndClear(); pWindow.disposeAndClear();
delete pImp; delete pImp;
pImp = NULL; pImp = NULL;
......
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