summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-10-29 15:43:12 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-11-01 06:45:57 +0100
commit0df4ec7d716b1623db9a90d198fa9832b520ecd1 (patch)
treec8c1e63dcf0928d82c554a9b0c7d6a206825f90b
parent207d8b88ecf43a945745194dc999348e570a5264 (diff)
loplugin:useuniqueptr in VclBuilder::preload
Change-Id: Ifda987ce3e9f24fb9e985a01ed8e39232f61e997 Reviewed-on: https://gerrit.libreoffice.org/62657 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--vcl/source/window/builder.cxx12
1 files changed, 3 insertions, 9 deletions
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index 9e1302041f17..85ed792d5f39 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -1465,16 +1465,10 @@ void VclBuilder::preload()
};
for (auto & lib : aWidgetLibs)
{
- OUStringBuffer sModuleBuf;
- sModuleBuf.append(SAL_DLLPREFIX);
- sModuleBuf.append(OUString::createFromAscii(lib));
- sModuleBuf.append(SAL_DLLEXTENSION);
- NoAutoUnloadModule* pModule = new NoAutoUnloadModule;
- OUString sModule = sModuleBuf.makeStringAndClear();
+ std::unique_ptr<NoAutoUnloadModule> pModule(new NoAutoUnloadModule);
+ OUString sModule = SAL_DLLPREFIX + OUString::createFromAscii(lib) + SAL_DLLEXTENSION;
if (pModule->loadRelative(&thisModule, sModule))
- g_aModuleMap.insert(std::make_pair(sModule, std::unique_ptr<NoAutoUnloadModule>(pModule)));
- else
- delete pModule;
+ g_aModuleMap.insert(std::make_pair(sModule, std::move(pModule)));
}
#endif // ENABLE_MERGELIBS
#endif // DISABLE_DYNLOADING