Skip to content
Permalink
Browse files

[ArcGIS REST] Also protect mCache.clear() by mutex

  • Loading branch information
manisandro committed Nov 22, 2017
1 parent 9ed2636 commit e9309eec7028aaf46535b7ee35a92daa718c628e
@@ -199,7 +199,7 @@ QgsRectangle QgsAfsProvider::extent() const

void QgsAfsProvider::reloadData()
{
mSharedData->mCache.clear();
mSharedData->clearCache();
}


@@ -17,9 +17,15 @@
#include "qgsarcgisrestutils.h"
#include "qgslogger.h"

void QgsAfsSharedData::clearCache()
{
QMutexLocker locker( &mMutex );
mCache.clear();
}

bool QgsAfsSharedData::getFeature( QgsFeatureId id, QgsFeature &f, bool fetchGeometry, const QList<int> & /*fetchAttributes*/, const QgsRectangle &filterRect )
{
QMutexLocker locker(&mMutex);
QMutexLocker locker( &mMutex );

// If cached, return cached feature
QMap<QgsFeatureId, QgsFeature>::const_iterator it = mCache.constFind( id );
@@ -34,6 +34,7 @@ class QgsAfsSharedData : public QObject
const QgsFields &fields() const { return mFields; }
QgsRectangle extent() const { return mExtent; }
QgsCoordinateReferenceSystem crs() const { return mSourceCRS; }
void clearCache();

bool getFeature( QgsFeatureId id, QgsFeature &f, bool fetchGeometry, const QList<int> &fetchAttributes, const QgsRectangle &filterRect = QgsRectangle() );

0 comments on commit e9309ee

Please sign in to comment.
You can’t perform that action at this time.