Skip to content
Permalink
Browse files

Remove redundant QgsOgrConnPool::{refS,unrefS}

  • Loading branch information
manisandro committed Feb 3, 2016
1 parent f9b77f3 commit 95030d61dc1000a3e385542576acd4c70c9886be
@@ -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 )

@@ -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 )
@@ -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()
@@ -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" )
{
@@ -2621,7 +2621,7 @@ bool QgsOgrProvider::syncToDisc()

mShapefileMayBeCorrupted = false;

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

updateExtents();

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

// ---------------------------------------------------------------------------

0 comments on commit 95030d6

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