Skip to content

Commit

Permalink
Remove redundant QgsOgrConnPool::{refS,unrefS}
Browse files Browse the repository at this point in the history
  • Loading branch information
manisandro committed Feb 3, 2016
1 parent f9b77f3 commit 95030d6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 16 deletions.
10 changes: 0 additions & 10 deletions src/providers/ogr/qgsogrconnpool.h
Expand Up @@ -146,16 +146,6 @@ class QgsOgrConnPool : public QgsConnectionPool<QgsOgrConn*, QgsOgrConnPoolGroup
mMutex.unlock();
}

static void refS( const QString &connInfo )
{
instance()->ref( connInfo );
}

static void unrefS( const QString &connInfo )
{
instance()->unref( connInfo );
}

protected:
Q_DISABLE_COPY( QgsOgrConnPool )

Expand Down
4 changes: 2 additions & 2 deletions src/providers/ogr/qgsogrfeatureiterator.cpp
Expand Up @@ -404,12 +404,12 @@ QgsOgrFeatureSource::QgsOgrFeatureSource( const QgsOgrProvider* p )
mFields = p->mAttributeFields;
mDriverName = p->ogrDriverName;
mOgrGeometryTypeFilter = wkbFlatten( p->mOgrGeometryTypeFilter );
QgsOgrConnPool::refS( mFilePath );
QgsOgrConnPool::instance()->ref( mFilePath );
}

QgsOgrFeatureSource::~QgsOgrFeatureSource()
{
QgsOgrConnPool::unrefS( mFilePath );
QgsOgrConnPool::instance()->unref( mFilePath );
}

QgsFeatureIterator QgsOgrFeatureSource::getFeatures( const QgsFeatureRequest& request )
Expand Down
8 changes: 4 additions & 4 deletions src/providers/ogr/qgsogrprovider.cpp
Expand Up @@ -374,7 +374,7 @@ QgsOgrProvider::QgsOgrProvider( QString const & uri )
<< QgsVectorDataProvider::NativeType( tr( "Date & Time" ), "datetime", QVariant::DateTime );
}

QgsOgrConnPool::refS( mFilePath );
QgsOgrConnPool::instance()->ref( mFilePath );
}

QgsOgrProvider::~QgsOgrProvider()
Expand Down Expand Up @@ -2590,7 +2590,7 @@ QString QgsOgrUtils::quotedValue( const QVariant& value )
bool QgsOgrProvider::syncToDisc()
{
//for shapefiles, remove spatial index files and create a new index
QgsOgrConnPool::unrefS( mFilePath );
QgsOgrConnPool::instance()->unref( mFilePath );
bool shapeIndex = false;
if ( ogrDriverName == "ESRI Shapefile" )
{
Expand Down Expand Up @@ -2621,7 +2621,7 @@ bool QgsOgrProvider::syncToDisc()

mShapefileMayBeCorrupted = false;

QgsOgrConnPool::refS( mFilePath );
QgsOgrConnPool::instance()->ref( mFilePath );
if ( shapeIndex )
{
return createSpatialIndex();
Expand Down Expand Up @@ -2834,7 +2834,7 @@ void QgsOgrProvider::close()

updateExtents();

QgsOgrConnPool::unrefS( mFilePath );
QgsOgrConnPool::instance()->unref( mFilePath );
}

// ---------------------------------------------------------------------------
Expand Down

0 comments on commit 95030d6

Please sign in to comment.