Skip to content
Permalink
Browse files
Consider feedback
  • Loading branch information
mhugent committed Nov 16, 2021
1 parent 663b2c7 commit cda7422412b96b53f36d28aeef8fa3050569388e
Showing with 3 additions and 7 deletions.
  1. +1 −2 src/core/providers/ogr/qgsogrfeatureiterator.cpp
  2. +1 −1 src/core/providers/ogr/qgsogrfeatureiterator.h
  3. +1 −4 src/core/providers/ogr/qgsogrproviderutils.h
@@ -55,7 +55,7 @@ QgsOgrFeatureIterator::QgsOgrFeatureIterator( QgsOgrFeatureSource *source, bool

if ( mSharedDS )
{
mTransactionDSLocker = new QMutexLocker( &mSharedDS->sharedDSMutex() );
mTransactionDSLocker.reset( new QMutexLocker( &mSharedDS->mutex() ) );
}

/* When inside a transaction for GPKG/SQLite and fetching fid(s) we might be nested inside an outer fetching loop,
@@ -284,7 +284,6 @@ QgsOgrFeatureIterator::QgsOgrFeatureIterator( QgsOgrFeatureSource *source, bool
QgsOgrFeatureIterator::~QgsOgrFeatureIterator()
{
close();
delete mTransactionDSLocker;
}

bool QgsOgrFeatureIterator::nextFeatureFilterExpression( QgsFeature &f )
@@ -104,7 +104,7 @@ class QgsOgrFeatureIterator final: public QgsAbstractFeatureIteratorFromSource<Q
QgsRectangle mFilterRect;
QgsCoordinateTransform mTransform;
QgsOgrDatasetSharedPtr mSharedDS = nullptr;
QMutexLocker *mTransactionDSLocker = nullptr;
std::unique_ptr<QMutexLocker> mTransactionDSLocker = nullptr;

bool mFirstFieldIsFid = false;
QgsFields mFieldsWithoutFid;
@@ -95,15 +95,14 @@ class CORE_EXPORT QgsOgrProviderUtils
#else
QRecursiveMutex mutex;
#endif
QMutex sharedDSMutex;
GDALDatasetH hDS = nullptr;
QMap<QString, QgsOgrLayer *> setLayers;
int refCount = 0;
bool canBeShared = true;

DatasetWithLayers()
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
: mutex( QMutex::Recursive ), sharedDSMutex( QMutex::Recursive )
: mutex( QMutex::Recursive )
#endif
{}
};
@@ -305,8 +304,6 @@ class QgsOgrDataset
QRecursiveMutex &mutex() { return mDs->mutex; }
#endif

QMutex &sharedDSMutex() { return mDs->sharedDSMutex; }

bool executeSQLNoReturn( const QString &sql );

OGRLayerH getLayerFromNameOrIndex( const QString &layerName, int layerIndex );

0 comments on commit cda7422

Please sign in to comment.