summaryrefslogtreecommitdiff
path: root/configmgr/source
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-11-21 11:46:43 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-11-21 12:28:23 +0100
commit48314f25241e014a634dd5371543b90137ffd2bc (patch)
treec55d6ef485fee3941bc1d3becb106d0dd77e7f2f /configmgr/source
parente41667762bfff43f95d1ee71b2d67903e4fdab4e (diff)
improve function-local statics in basic..cui
Change-Id: If737e8478f6f1c8fffb060ce132d80e0f07ef8ee Reviewed-on: https://gerrit.libreoffice.org/63701 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'configmgr/source')
-rw-r--r--configmgr/source/lock.cxx4
1 files changed, 1 insertions, 3 deletions
diff --git a/configmgr/source/lock.cxx b/configmgr/source/lock.cxx
index 9258b35bfeb7..3c0e25d432c5 100644
--- a/configmgr/source/lock.cxx
+++ b/configmgr/source/lock.cxx
@@ -27,9 +27,7 @@ namespace configmgr {
std::shared_ptr<osl::Mutex> const & lock()
{
- static std::shared_ptr<osl::Mutex> theLock;
- if (!theLock.get())
- theLock.reset(new osl::Mutex);
+ static std::shared_ptr<osl::Mutex> theLock(new osl::Mutex);
return theLock;
}