Skip to content

Commit

Permalink
Fix possible corruption of cache
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Apr 17, 2017
1 parent 3ada8a2 commit ca2b199
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/core/qgsdistancearea.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,17 +98,14 @@ bool QgsDistanceArea::setEllipsoid( const QString &ellipsoid )
if ( cacheIt != sEllipsoidCache.constEnd() )
{
// found a match in the cache
sEllipsoidCacheLock.unlock();
if ( cacheIt.value().valid )
bool result = cacheIt.value().valid;
if ( result )
{
mEllipsoid = ellipsoid;
setFromParams( cacheIt.value() );
return true;
}
else
{
return false;
}
sEllipsoidCacheLock.unlock();
return result;
}
sEllipsoidCacheLock.unlock();

Expand Down

0 comments on commit ca2b199

Please sign in to comment.