Skip to content

Commit

Permalink
Use lock/unlock directly instead QMutexLocker to avoid compilation pr…
Browse files Browse the repository at this point in the history
…oblems on Qt6
  • Loading branch information
mhugent authored and github-actions[bot] committed Nov 18, 2021
1 parent 05e69bf commit 5bedbda
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/core/providers/ogr/qgsogrfeatureiterator.cpp
Expand Up @@ -55,7 +55,7 @@ QgsOgrFeatureIterator::QgsOgrFeatureIterator( QgsOgrFeatureSource *source, bool

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

/* When inside a transaction for GPKG/SQLite and fetching fid(s) we might be nested inside an outer fetching loop,
Expand Down Expand Up @@ -488,9 +488,9 @@ bool QgsOgrFeatureIterator::close()
{
iteratorClosed();
mOgrLayer = nullptr;
mSharedDS.reset();

mClosed = true;
mSharedDS->mutex().unlock();
mSharedDS.reset();
return true;
}

Expand Down
3 changes: 0 additions & 3 deletions src/core/providers/ogr/qgsogrfeatureiterator.h
Expand Up @@ -27,8 +27,6 @@
#include <set>
#include "qgis_sip.h"

#include <QMutexLocker>

///@cond PRIVATE
#define SIP_NO_FILE

Expand Down Expand Up @@ -106,7 +104,6 @@ class QgsOgrFeatureIterator final: public QgsAbstractFeatureIteratorFromSource<Q
QgsRectangle mFilterRect;
QgsCoordinateTransform mTransform;
QgsOgrDatasetSharedPtr mSharedDS = nullptr;
std::unique_ptr<QMutexLocker> mTransactionDSLocker = nullptr;

bool mFirstFieldIsFid = false;
QgsFields mFieldsWithoutFid;
Expand Down

0 comments on commit 5bedbda

Please sign in to comment.