[PATCH] Change in core[libreoffice-4-0]: Resolves: fdo#55974 segfault while closing an Impress file

Caolán McNamara (via_Code_Review) gerrit at gerrit.libreoffice.org
Wed Jan 16 07:59:04 PST 2013


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/1718

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/18/1718/1

Resolves: fdo#55974 segfault while closing an Impress file

regression since aa1927dc257b52edf96de220cc3797e02c83a0ae

 mpViewShell(pViewShell),
+mpSlideSorterViewShell(
          ::boost::dynamic_pointer_cast< ::sd::slidesorter::SlideSorterViewShell >( pViewShell )),

both are boost::shared_ptr potentially to the same thing then, given that we
reset mpViewShell in ::disposing we presumably have to do the same thing to
mpSlideSorterViewShell.

add unset check on mpSlideSorterViewShell usages while I'm at it

Change-Id: I35f51977c40f946a49789abd9405a4ef84aea0e8
(cherry picked from commit a0d852b2ade42289af1e9b066a48c97aedeff3b1)
---
M sd/source/ui/framework/factories/ViewShellWrapper.cxx
1 file changed, 7 insertions(+), 0 deletions(-)



diff --git a/sd/source/ui/framework/factories/ViewShellWrapper.cxx b/sd/source/ui/framework/factories/ViewShellWrapper.cxx
index 2768e99..bc50d9b 100644
--- a/sd/source/ui/framework/factories/ViewShellWrapper.cxx
+++ b/sd/source/ui/framework/factories/ViewShellWrapper.cxx
@@ -95,6 +95,7 @@
         xWindow->removeWindowListener(this);
     }
 
+    mpSlideSorterViewShell.reset();
     mpViewShell.reset();
 }
 
@@ -145,6 +146,9 @@
 
 sal_Bool SAL_CALL ViewShellWrapper::select( const ::com::sun::star::uno::Any& aSelection ) throw(lang::IllegalArgumentException, uno::RuntimeException)
 {
+    if (!mpSlideSorterViewShell)
+        return false;
+
     bool bOk = true;
 
     ::sd::slidesorter::controller::SlideSorterController& rSlideSorterController
@@ -180,6 +184,9 @@
 {
     Any aResult;
 
+    if (!mpSlideSorterViewShell)
+        return aResult;
+
     slidesorter::model::PageEnumeration aSelectedPages (
         slidesorter::model::PageEnumerationProvider::CreateSelectedPagesEnumeration(
             mpSlideSorterViewShell->GetSlideSorter().GetModel()));

-- 
To view, visit https://gerrit.libreoffice.org/1718
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I35f51977c40f946a49789abd9405a4ef84aea0e8
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: libreoffice-4-0
Gerrit-Owner: Caolán McNamara <caolanm at redhat.com>



More information about the LibreOffice mailing list