From 8196dab4f450d96905f0bbfe650ae7a78c8972e2 Mon Sep 17 00:00:00 2001 From: Jian Fang Zhang Date: Tue, 11 Sep 2012 12:30:18 +0000 Subject: 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 --- chart2/source/view/main/ChartView.cxx | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'chart2') diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx index e5ae969c483d..a19a4130914e 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*/ ); -- cgit