Skip to content

Commit ca2b199

Browse files
committed
Fix possible corruption of cache
1 parent 3ada8a2 commit ca2b199

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/core/qgsdistancearea.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -98,17 +98,14 @@ bool QgsDistanceArea::setEllipsoid( const QString &ellipsoid )
9898
if ( cacheIt != sEllipsoidCache.constEnd() )
9999
{
100100
// found a match in the cache
101-
sEllipsoidCacheLock.unlock();
102-
if ( cacheIt.value().valid )
101+
bool result = cacheIt.value().valid;
102+
if ( result )
103103
{
104104
mEllipsoid = ellipsoid;
105105
setFromParams( cacheIt.value() );
106-
return true;
107-
}
108-
else
109-
{
110-
return false;
111106
}
107+
sEllipsoidCacheLock.unlock();
108+
return result;
112109
}
113110
sEllipsoidCacheLock.unlock();
114111

0 commit comments

Comments
 (0)