[Libreoffice-commits] core.git: chart2/source

Bjoern Michaelsen bjoern.michaelsen at canonical.com
Fri Mar 3 10:22:46 UTC 2017


 chart2/source/controller/main/ChartController.cxx |   18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

New commits:
commit 926c0d73e82bb1d5644c49fb95c56e241b6c8f34
Author: Bjoern Michaelsen <bjoern.michaelsen at canonical.com>
Date:   Fri Mar 3 00:11:50 2017 +0100

    tdf#99352: ensure ChartController is disposing its VclPtrs on DeInitVCL
    
    Change-Id: I46851debe8a0bdc1ff871ee9ba34ca41f89b844b
    Reviewed-on: https://gerrit.libreoffice.org/34841
    Tested-by: Björn Michaelsen <bjoern.michaelsen at canonical.com>
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
    Tested-by: Michael Meeks <michael.meeks at collabora.com>

diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx
index 0322808..93798c0 100644
--- a/chart2/source/controller/main/ChartController.cxx
+++ b/chart2/source/controller/main/ChartController.cxx
@@ -79,6 +79,7 @@
 #include <com/sun/star/frame/XLayoutManager.hpp>
 #include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
 
+
 // this is needed to properly destroy the unique_ptr to the AcceleratorExecute
 // object in the DTOR
 #include <svtools/acceleratorexecute.hxx>
@@ -441,15 +442,15 @@ void SAL_CALL ChartController::attachFrame(
         pParent = VCLUnoHelper::GetWindow( xContainerWindow ).get();
     }
 
-    if(m_pChartWindow)
-    {
-        //@todo delete ...
-        m_pChartWindow->clear();
-        m_apDropTargetHelper.reset();
-    }
     {
         // calls to VCL
         SolarMutexGuard aSolarGuard;
+        if(m_pChartWindow)
+        {
+            //@todo delete ...
+            m_pChartWindow->clear();
+            m_apDropTargetHelper.reset();
+        }
         m_pChartWindow = VclPtr<ChartWindow>::Create(this,pParent,pParent?pParent->GetStyle():0);
         m_pChartWindow->SetBackground();//no Background
         m_xViewWindow.set( m_pChartWindow->GetComponentInterface(), uno::UNO_QUERY );
@@ -764,7 +765,9 @@ void ChartController::impl_deleteDrawViewController()
 
 void SAL_CALL ChartController::dispose()
 {
+    SolarMutexGuard aSolarGuard;
     m_bDisposed = true;
+    m_pChartWindow.disposeAndClear();
 
     if (getModel().is())
     {
@@ -818,15 +821,12 @@ void SAL_CALL ChartController::dispose()
                 xViewBroadcaster->removeModeChangeListener(this);
 
             impl_invalidateAccessible();
-            SolarMutexGuard aSolarGuard;
             impl_deleteDrawViewController();
             m_pDrawModelWrapper.reset();
 
             m_apDropTargetHelper.reset();
 
             //the accessible view is disposed within window destructor of m_pChartWindow
-            m_pChartWindow->clear();
-            m_pChartWindow = nullptr;//m_pChartWindow is deleted via UNO due to dispose of m_xViewWindow (triggered by Framework (Controller pretends to be XWindow also))
             m_xViewWindow->dispose();
             m_xChartView.clear();
         }


More information about the Libreoffice-commits mailing list