[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - include/sfx2 sfx2/source
Caolán McNamara
caolanm at redhat.com
Wed Jul 8 01:37:13 PDT 2015
include/sfx2/childwin.hxx | 2 ++
sfx2/source/appl/childwin.cxx | 17 +++++++++++------
2 files changed, 13 insertions(+), 6 deletions(-)
New commits:
commit a26723f028a9795104e12b5f98cddb53471b44d2
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Jul 7 13:47:14 2015 +0100
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 at collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos at collabora.co.uk>
diff --git a/include/sfx2/childwin.hxx b/include/sfx2/childwin.hxx
index eb43f8e..7214005 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 0b41d43..35e53d6 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;
More information about the Libreoffice-commits
mailing list