From 0323253a7c67316cb96e4a64792ab4fe74aac1ca Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 1 Jun 2016 16:22:29 +0200 Subject: remove some manual ref-counting triggered when I noticed a class doing acquire() in the constructor and then release() in the destructor. found mostly by git grep -n -B5 -e '->release()' Change-Id: I96e43a3d30ffd9ae9a34275f24cd914d8f7b026f Reviewed-on: https://gerrit.libreoffice.org/25806 Tested-by: Jenkins Reviewed-by: Noel Grandin --- xmloff/source/draw/animationexport.cxx | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'xmloff') diff --git a/xmloff/source/draw/animationexport.cxx b/xmloff/source/draw/animationexport.cxx index b9180575fe73..9be390ed7a5a 100644 --- a/xmloff/source/draw/animationexport.cxx +++ b/xmloff/source/draw/animationexport.cxx @@ -531,7 +531,7 @@ private: SvXMLExport& mrExport; Reference< XInterface > mxExport; Reference< XPropertySet > mxPageProps; - XMLSdPropHdlFactory* mpSdPropHdlFactory; + rtl::Reference mxSdPropHdlFactory; }; AnimationsExporterImpl::AnimationsExporterImpl( SvXMLExport& rExport, const Reference< XPropertySet >& xPageProps ) @@ -548,19 +548,11 @@ AnimationsExporterImpl::AnimationsExporterImpl( SvXMLExport& rExport, const Refe OSL_FAIL( "xmloff::AnimationsExporterImpl::AnimationsExporterImpl(), RuntimeException caught!" ); } - mpSdPropHdlFactory = new XMLSdPropHdlFactory( mrExport.GetModel(), mrExport ); - // set lock to avoid deletion - mpSdPropHdlFactory->acquire(); + mxSdPropHdlFactory = new XMLSdPropHdlFactory( mrExport.GetModel(), mrExport ); } AnimationsExporterImpl::~AnimationsExporterImpl() { - // cleanup factory, decrease refcount. Should lead to destruction. - if(mpSdPropHdlFactory) - { - mpSdPropHdlFactory->release(); - mpSdPropHdlFactory = nullptr; - } } void AnimationsExporterImpl::exportTransitionNode() @@ -1524,7 +1516,7 @@ void AnimationsExporterImpl::convertValue( XMLTokenEnum eAttributeName, OUString } //const XMLPropertyHandler* pHandler = static_cast(&mrExport)->GetSdPropHdlFactory()->GetPropertyHandler( nType ); - const XMLPropertyHandler* pHandler = mpSdPropHdlFactory->GetPropertyHandler( nType ); + const XMLPropertyHandler* pHandler = mxSdPropHdlFactory->GetPropertyHandler( nType ); if( pHandler ) { OUString aString; -- cgit