diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-12-12 13:35:14 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-12-13 07:24:48 +0100 |
commit | c5424e19338a3edaec3f0459c8ac5d53ca92d9fe (patch) | |
tree | 8a0a1c3b5d80cd21474fcf45ab745cee03093a5d /i18npool/source/localedata | |
parent | c908f61d722624e40f3c6985243c6cb37dabafe0 (diff) |
loplugin:useuniqueptr in i18npool
Change-Id: I57c6ce2a8c48bc87404e596b8843efd67ea0872d
Reviewed-on: https://gerrit.libreoffice.org/65033
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'i18npool/source/localedata')
-rw-r--r-- | i18npool/source/localedata/localedata.cxx | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/i18npool/source/localedata/localedata.cxx b/i18npool/source/localedata/localedata.cxx index 374244eefbe6..118781d7a6b4 100644 --- a/i18npool/source/localedata/localedata.cxx +++ b/i18npool/source/localedata/localedata.cxx @@ -561,16 +561,17 @@ oslGenericFunction lcl_LookupTableHelper::getFunctionSymbolByName( aBuf.ensureCapacity(strlen(i.pLib) + 4); // mostly "*.dll" aBuf.appendAscii(i.pLib).append( SAL_DLLEXTENSION ); #endif - osl::Module *module = new osl::Module(); + std::unique_ptr<osl::Module> module(new osl::Module()); if ( module->loadRelative(&thisModule, aBuf.makeStringAndClear()) ) { ::osl::MutexGuard aGuard( maMutex ); - maLookupTable.emplace_back(i.pLib, module, i.pLocale); + auto pTmpModule = module.get(); + maLookupTable.emplace_back(i.pLib, module.release(), i.pLocale); OSL_ASSERT( pOutCachedItem ); if( pOutCachedItem ) { pOutCachedItem->reset(new LocaleDataLookupTableItem( maLookupTable.back() )); - return module->getFunctionSymbol( + return pTmpModule->getFunctionSymbol( aBuf.appendAscii(pFunction).append(cUnder). appendAscii((*pOutCachedItem)->localeName).makeStringAndClear()); } @@ -578,7 +579,7 @@ oslGenericFunction lcl_LookupTableHelper::getFunctionSymbolByName( return nullptr; } else - delete module; + module.reset(); #else (void) pOutCachedItem; |