diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-02-16 14:49:45 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-02-16 15:34:47 +0000 |
commit | d929a1715da3088229f6b41b03e9713fe110b881 (patch) | |
tree | 936e17c08be2b3442c0f0aa36b74bab90dff5e0f /scaddins/source/analysis | |
parent | bdee6631e8b2d7e30f4dd5d2a6c529fe91888357 (diff) |
Related: fdo#74880 small leak in scaddins
Change-Id: I331a3a358c5275b770aa1319f43af21b9bb3fd83
Diffstat (limited to 'scaddins/source/analysis')
-rw-r--r-- | scaddins/source/analysis/analysis.cxx | 29 |
1 files changed, 9 insertions, 20 deletions
diff --git a/scaddins/source/analysis/analysis.cxx b/scaddins/source/analysis/analysis.cxx index f7b7fe8f62e0..de02b1c7adbf 100644 --- a/scaddins/source/analysis/analysis.cxx +++ b/scaddins/source/analysis/analysis.cxx @@ -120,14 +120,10 @@ OUString AnalysisAddIn::GetFuncDescrStr( sal_uInt16 nResId, sal_uInt16 nStrIndex void AnalysisAddIn::InitData( void ) { - if( pResMgr ) - delete pResMgr; - - OString aModName( "analysis" ); - pResMgr = ResMgr::CreateResMgr( aModName.getStr(), LanguageTag( aFuncLoc) ); + delete pResMgr; + pResMgr = ResMgr::CreateResMgr("analysis", LanguageTag(aFuncLoc)); - if( pFD ) - delete pFD; + delete pFD; if( pResMgr ) pFD = new FuncDataList( *pResMgr ); @@ -153,17 +149,11 @@ AnalysisAddIn::AnalysisAddIn( const uno::Reference< uno::XComponentContext >& xC AnalysisAddIn::~AnalysisAddIn() { - if( pFD ) - delete pFD; - - if( pFactDoubles ) - delete[] pFactDoubles; - - if( pCDL ) - delete pCDL; - - if( pDefLocales ) - delete[] pDefLocales; + delete pResMgr; + delete pCDL; + delete[] pFactDoubles; + delete pFD; + delete[] pDefLocales; } sal_Int32 AnalysisAddIn::getDateMode( @@ -235,8 +225,7 @@ uno::Sequence< OUString > AnalysisAddIn::getSupportedServiceNames_Static() uno::Reference< uno::XInterface > SAL_CALL AnalysisAddIn_CreateInstance( const uno::Reference< lang::XMultiServiceFactory >& xServiceFact ) { - static uno::Reference< uno::XInterface > xInst = (cppu::OWeakObject*) new AnalysisAddIn( comphelper::getComponentContext(xServiceFact) ); - return xInst; + return (cppu::OWeakObject*) new AnalysisAddIn( comphelper::getComponentContext(xServiceFact) ); } // XServiceName |