[Libreoffice-commits] core.git: vcl/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Thu Nov 1 05:46:27 UTC 2018
vcl/source/window/builder.cxx | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
New commits:
commit 0df4ec7d716b1623db9a90d198fa9832b520ecd1
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Mon Oct 29 15:43:12 2018 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Thu Nov 1 06:45:57 2018 +0100
loplugin:useuniqueptr in VclBuilder::preload
Change-Id: Ifda987ce3e9f24fb9e985a01ed8e39232f61e997
Reviewed-on: https://gerrit.libreoffice.org/62657
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
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
More information about the Libreoffice-commits
mailing list