replace double checked locking patterns
with thread safe static initialization Change-Id: I4c751a47e3bdf52bbfb67d4f3aabd6f442e30118 Reviewed-on: https://gerrit.libreoffice.org/58287 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
committed by
Noel Grandin
parent
1eeb8d3476
commit
c9697dc2ab
@@ -158,17 +158,10 @@ struct MappingsData
|
||||
|
||||
static MappingsData & getMappingsData()
|
||||
{
|
||||
static MappingsData * s_p = nullptr;
|
||||
if (! s_p)
|
||||
{
|
||||
MutexGuard aGuard( Mutex::getGlobalMutex() );
|
||||
if (! s_p)
|
||||
{
|
||||
//TODO This memory is leaked; see #i63473# for when this should be
|
||||
// changed again:
|
||||
s_p = new MappingsData;
|
||||
}
|
||||
}
|
||||
//TODO This memory is leaked; see #i63473# for when this should be
|
||||
// changed again:
|
||||
static MappingsData * s_p(new MappingsData);
|
||||
|
||||
return *s_p;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user