diff -Naur chart2.31m11/chart2/source/model/main/ImplChartModel.cxx chart2.fix/chart2/source/model/main/ImplChartModel.cxx --- chart2.31m11/chart2/source/model/main/ImplChartModel.cxx 2009-02-19 00:07:12.000000000 +0800 +++ chart2.fix/chart2/source/model/main/ImplChartModel.cxx 2010-08-11 11:31:35.593750000 +0800 @@ -135,6 +135,7 @@ GetStyleFamilies(); CreateDefaultChartTypeTemplate(); + pNumFormatter = NULL; // memory leak } ImplChartModel::ImplChartModel( const ImplChartModel & rOther, const Reference< util::XModifyListener > & xListener ) : @@ -160,6 +161,8 @@ m_xXMLNamespaceMap.set( CreateRefClone< Reference< container::XNameAccess > >()( rOther.m_xXMLNamespaceMap )); CloneRefVector< Reference< chart2::XDiagram > >( rOther.m_aDiagrams, m_aDiagrams ); + + pNumFormatter = NULL; // memory leak } ImplChartModel::~ImplChartModel() @@ -454,6 +457,11 @@ // note: m_xModifyListener is the ChartModel, so don't call dispose() m_xModifyListener.clear(); + if ( pNumFormatter ) { // memory leak + delete pNumFormatter; + pNumFormatter = NULL; + } + m_bIsDisposed = true; } @@ -577,7 +585,8 @@ if( !m_xOwnNumberFormatsSupplier.is() ) { Reference< lang::XMultiServiceFactory > xFactory( m_xContext->getServiceManager(), uno::UNO_QUERY ); - m_xOwnNumberFormatsSupplier = new SvNumberFormatsSupplierObj( new SvNumberFormatter( xFactory, LANGUAGE_SYSTEM ) ); + pNumFormatter = new SvNumberFormatter( xFactory, LANGUAGE_SYSTEM ); // memory leak + m_xOwnNumberFormatsSupplier = new SvNumberFormatsSupplierObj( pNumFormatter/*new SvNumberFormatter( xFactory, LANGUAGE_SYSTEM )*/ ); //pOwnNumberFormatter->ChangeStandardPrec( 15 ); todo? } m_xNumberFormatsSupplier = m_xOwnNumberFormatsSupplier; diff -Naur chart2.31m11/chart2/source/model/main/ImplChartModel.hxx chart2.fix/chart2/source/model/main/ImplChartModel.hxx --- chart2.31m11/chart2/source/model/main/ImplChartModel.hxx 2008-10-01 16:35:04.000000000 +0800 +++ chart2.fix/chart2/source/model/main/ImplChartModel.hxx 2010-08-11 11:32:04.484375000 +0800 @@ -244,6 +244,8 @@ ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess> m_xXMLNamespaceMap; ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener > m_xModifyListener; + + SvNumberFormatter * pNumFormatter; // memory leak }; } // namespace impl