diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-07-07 13:47:14 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-07-08 08:36:36 +0000 |
commit | a26723f028a9795104e12b5f98cddb53471b44d2 (patch) | |
tree | 62944c6947084ba4e1eccb0361abadf996207b7e | |
parent | f932f1197e1cabd901231223dc9c7ce9c171120e (diff) |
Related: tdf#92392 clear workwins that point to pWindow
before trying to destroy pWindow
Change-Id: I7257096e8da2a5d6753ad2091287d63ea9ae244b
(cherry picked from commit 3c6eec0d99a2bb84bd6719ad498d5de54dc959fe)
Reviewed-on: https://gerrit.libreoffice.org/16832
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
-rw-r--r-- | include/sfx2/childwin.hxx | 2 | ||||
-rw-r--r-- | sfx2/source/appl/childwin.cxx | 17 |
2 files changed, 13 insertions, 6 deletions
diff --git a/include/sfx2/childwin.hxx b/include/sfx2/childwin.hxx index eb43f8e38343..7214005e7906 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 0b41d4301985..35e53d6e8892 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; |