Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Consider feedback
  • Loading branch information
mhugent authored and github-actions[bot] committed Nov 18, 2021
1 parent 90487c5 commit eb9f792
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
3 changes: 1 addition & 2 deletions src/core/providers/ogr/qgsogrfeatureiterator.cpp
Expand Up @@ -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,
Expand Down Expand Up @@ -284,7 +284,6 @@ QgsOgrFeatureIterator::QgsOgrFeatureIterator( QgsOgrFeatureSource *source, bool
QgsOgrFeatureIterator::~QgsOgrFeatureIterator()
{
close();
delete mTransactionDSLocker;
}

bool QgsOgrFeatureIterator::nextFeatureFilterExpression( QgsFeature &f )
Expand Down
2 changes: 1 addition & 1 deletion src/core/providers/ogr/qgsogrfeatureiterator.h
Expand Up @@ -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;
Expand Down
5 changes: 1 addition & 4 deletions src/core/providers/ogr/qgsogrproviderutils.h
Expand Up @@ -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
{}
};
Expand Down Expand Up @@ -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 );
Expand Down

0 comments on commit eb9f792

Please sign in to comment.