Skip to content

Commit

Permalink
Protect postgis crs cache with mutex
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Aug 5, 2017
1 parent 8e20076 commit 0854e79
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/providers/postgres/qgspostgresprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3950,6 +3950,8 @@ QgsCoordinateReferenceSystem QgsPostgresProvider::crs() const
srs.createFromSrid( srid );
if ( !srs.isValid() )
{
static QMutex sMutex;
QMutexLocker locker( &sMutex );
static QMap<int, QgsCoordinateReferenceSystem> sCrsCache;
if ( sCrsCache.contains( srid ) )
srs = sCrsCache.value( srid );
Expand Down

0 comments on commit 0854e79

Please sign in to comment.