[Libreoffice-commits] core.git: 2 commits - chart2/source
Jian Fang Zhang
zhangjf at apache.org
Fri May 31 07:00:20 PDT 2013
chart2/source/model/main/ChartModel.cxx | 3 +++
chart2/source/view/main/ChartView.cxx | 6 ++++++
2 files changed, 9 insertions(+)
New commits:
commit 8196dab4f450d96905f0bbfe650ae7a78c8972e2
Author: Jian Fang Zhang <zhangjf at apache.org>
Date: Tue Sep 11 12:30:18 2012 +0000
Resolves: #i120831# call dispose() from ChartView dtor...
to make sure SfxBaseModel object is freed correctly
Found by: zhangjf
Patch by: zhangjf
(cherry picked from commit 4cb73634a602272d8de33dfe23722912e4494bbc)
Change-Id: I9e316178ef273b13e77d0b166f17fc700363f7bb
diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx
index e5ae969..a19a413 100644
--- a/chart2/source/view/main/ChartView.cxx
+++ b/chart2/source/view/main/ChartView.cxx
@@ -200,6 +200,12 @@ void SAL_CALL ChartView::initialize( const uno::Sequence< uno::Any >& aArguments
ChartView::~ChartView()
{
+ // #i120831#. In ChartView::initialize(), m_xShapeFactory is created from SdrModel::getUnoModel() and indirectly
+ // from SfxBaseModel, it needs call dispose() to make sure SfxBaseModel object is freed correctly.
+ uno::Reference< lang::XComponent > xComp( m_xShapeFactory, uno::UNO_QUERY);
+ if ( xComp.is() )
+ xComp->dispose();
+
if( m_pDrawModelWrapper.get() )
{
EndListening( m_pDrawModelWrapper->getSdrModel(), false /*bAllDups*/ );
commit 275225ed4d401d306c75de92fb980a6a3f85c635
Author: Jian Fang Zhang <zhangjf at apache.org>
Date: Tue Sep 11 12:20:33 2012 +0000
Resolves: #i120828#, restore some ChartModel::dispose() calls..
to break cyclic reference
Found by: zhangjf
Patch by: zhangjf
(cherry picked from commit 1c564cb9a46fc6435750f9f1a70f654b52efd970)
Change-Id: I8aaac18584d55d9f381acdf4deb0e704bc9bcfc1
diff --git a/chart2/source/model/main/ChartModel.cxx b/chart2/source/model/main/ChartModel.cxx
index e2157c4..aa5f78f 100644
--- a/chart2/source/model/main/ChartModel.cxx
+++ b/chart2/source/model/main/ChartModel.cxx
@@ -556,6 +556,9 @@ void SAL_CALL ChartModel::dispose() throw(uno::RuntimeException)
m_pUndoManager.clear();
// that's important, since the UndoManager implementation delegates its ref counting to ourself.
+ if( m_xOldModelAgg.is()) // #i120828#, to release cyclic reference to ChartModel object
+ m_xOldModelAgg->setDelegator( 0 );
+
m_aControllers.disposeAndClear( lang::EventObject( static_cast< cppu::OWeakObject * >( this )));
m_xCurrentController.clear();
More information about the Libreoffice-commits
mailing list