summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-07-07 13:47:14 +0100
committerCaolán McNamara <caolanm@redhat.com>2015-07-07 19:48:01 +0100
commit3c6eec0d99a2bb84bd6719ad498d5de54dc959fe (patch)
tree2479d40bcb382ba810a6f50ad293bc5835599fe2
parent8e20a25319e16d2f74e18696480556bc841a1679 (diff)
Related: tdf#92392 clear workwins that point to pWindow
before trying to destroy pWindow Change-Id: I7257096e8da2a5d6753ad2091287d63ea9ae244b
-rw-r--r--include/sfx2/childwin.hxx2
-rw-r--r--sfx2/source/appl/childwin.cxx17
2 files changed, 13 insertions, 6 deletions
diff --git a/include/sfx2/childwin.hxx b/include/sfx2/childwin.hxx
index cffb5b634ed9..e2a4c5248b1b 100644
--- a/include/sfx2/childwin.hxx
+++ b/include/sfx2/childwin.hxx
@@ -163,6 +163,8 @@ private:
GetContext() const
{ return pContext; }
+ SAL_DLLPRIVATE void ClearWorkwin();
+
protected:
SfxChildWindow(vcl::Window *pParentWindow, sal_uInt16 nId);
diff --git a/sfx2/source/appl/childwin.cxx b/sfx2/source/appl/childwin.cxx
index 3346ac2aa362..3c7464305316 100644
--- a/sfx2/source/appl/childwin.cxx
+++ b/sfx2/source/appl/childwin.cxx
@@ -177,12 +177,7 @@ void SfxChildWindow::Destroy()
{
if ( GetFrame().is() )
{
- if (pImp->pWorkWin)
- {
- if (pImp->pWorkWin->GetActiveChild_Impl() == pWindow)
- pImp->pWorkWin->SetActiveChild_Impl(NULL);
- pImp->pWorkWin = NULL;
- }
+ ClearWorkwin();
try
{
::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()
delete this;
}
+void SfxChildWindow::ClearWorkwin()
+{
+ if (pImp->pWorkWin)
+ {
+ if (pImp->pWorkWin->GetActiveChild_Impl() == pWindow)
+ pImp->pWorkWin->SetActiveChild_Impl(NULL);
+ pImp->pWorkWin = NULL;
+ }
+}
SfxChildWindow::~SfxChildWindow()
{
delete pContext;
pContext = NULL;
+ ClearWorkwin();
pWindow.disposeAndClear();
delete pImp;
pImp = NULL;