Skip to content

Commit

Permalink
fixup_02b11050f19895fe13ba8be27021e27ecac9357f
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed May 29, 2020
1 parent 02ac606 commit bfaf0ef
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions src/core/auth/qgsauthmanager.cpp
Expand Up @@ -84,18 +84,11 @@ const QString QgsAuthManager::AUTH_PASSWORD_HELPER_DISPLAY_NAME( "Password Manag

QgsAuthManager *QgsAuthManager::instance()
{
// NOTE cppcheck complains about identicalInnerCondition. Pedantically
// the below construct is not totally thread-safe.
// See https://preshing.com/20130930/double-checked-locking-is-fixed-in-cpp11/
// regarding double-checked locking pattern (DCLP)
static QMutex sMutex;
QMutexLocker locker( &sMutex );
if ( !sInstance )
{
static QMutex sMutex;
QMutexLocker locker( &sMutex );
if ( !sInstance )
{
sInstance = new QgsAuthManager( );
}
sInstance = new QgsAuthManager( );
}
return sInstance;
}
Expand Down

0 comments on commit bfaf0ef

Please sign in to comment.