diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-07-07 13:47:14 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2015-08-06 12:55:45 +0200 |
commit | d8722a7e0f9854b4a2c625dc8209788bd4d2edb8 (patch) | |
tree | 846ed41060de598acecf145749f3ccc83e4a4c9e /sfx2 | |
parent | 9dd6148acf26b21ce4f1e2b4fb450de7ee4e9f82 (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>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/appl/childwin.cxx | 17 |
1 files changed, 11 insertions, 6 deletions
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; |