[Libreoffice-commits] core.git: starmath/inc starmath/source

Stephan Bergmann sbergman at redhat.com
Tue Oct 14 00:07:03 PDT 2014


 starmath/inc/view.hxx    |    6 +++++-
 starmath/source/view.cxx |    1 -
 2 files changed, 5 insertions(+), 2 deletions(-)

New commits:
commit b80c468e35ee321b5580b42642064f74f9241fb6
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Oct 14 09:02:12 2014 +0200

    SmViewShell: pImpl must outlive aGraphic member
    
    ...as at least during CppunitTest_starmath_qa_cppunit, during ~SmViewShell,
    aGraphic's code calls back into SmViewShell's code calls into pImpl:
    
     SmViewShell::IsInlineEditEnabled() const starmath/source/view.cxx:2057:12
     SmGraphicWindow::IsInlineEditEnabled() const starmath/source/view.cxx:227:12
     SmGraphicWindow::CaretBlinkStop() starmath/source/view.cxx:297:10
     SmGraphicWindow::~SmGraphicWindow() starmath/source/view.cxx:126:5
     SmViewShell::~SmViewShell() starmath/source/view.cxx:1976:1
     [...]
    
    This is somewhat symmetric to 0e263d61811480f3a9dbc6ad7c752f6cfae4e3fc "order
    pImpl before aGraphic because aGraphic deferences pImpl in ctor."
    
    Change-Id: I97494bebaf5747205a690e6d65fd05ba8fb61cab

diff --git a/starmath/inc/view.hxx b/starmath/inc/view.hxx
index 215ac54..b23572e 100644
--- a/starmath/inc/view.hxx
+++ b/starmath/inc/view.hxx
@@ -19,6 +19,10 @@
 #ifndef INCLUDED_STARMATH_INC_VIEW_HXX
 #define INCLUDED_STARMATH_INC_VIEW_HXX
 
+#include <sal/config.h>
+
+#include <memory>
+
 #include <sfx2/dockwin.hxx>
 #include <sfx2/viewsh.hxx>
 #include <svtools/scrwin.hxx>
@@ -224,7 +228,7 @@ class SmViewShell: public SfxViewShell
     // for handling the PasteClipboardState
     friend class SmClipboardChangeListener;
 
-    SmViewShell_Impl*   pImpl;
+    std::unique_ptr<SmViewShell_Impl> pImpl;
 
     SmGraphicWindow     aGraphic;
     SmGraphicController aGraphicController;
diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index 075941d..5587479 100644
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -1972,7 +1972,6 @@ SmViewShell::~SmViewShell()
     SmEditWindow *pEditWin = GetEditWindow();
     if (pEditWin)
         pEditWin->DeleteEditView( *this );
-    delete pImpl;
 }
 
 void SmViewShell::Deactivate( bool bIsMDIActivate )


More information about the Libreoffice-commits mailing list