Skip to content

Commit

Permalink
[ogr provider] insure connection pool updated when subset sql added/c…
Browse files Browse the repository at this point in the history
…hanged (#5172)
  • Loading branch information
nirvn committed Sep 12, 2017
1 parent 06c5d24 commit 9b8fad5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/providers/ogr/qgsogrprovider.cpp
Expand Up @@ -543,7 +543,12 @@ bool QgsOgrProvider::setSubsetString( const QString &theSQL, bool updateFeatureC
uri += QStringLiteral( "|geometrytype=%1" ).arg( ogrWkbGeometryTypeName( mOgrGeometryTypeFilter ) );
}

setDataSourceUri( uri );
if ( uri != dataSourceUri() )
{
QgsOgrConnPool::instance()->unref( dataSourceUri() );
setDataSourceUri( uri );
QgsOgrConnPool::instance()->ref( dataSourceUri() );
}

OGR_L_ResetReading( ogrLayer );

Expand Down

0 comments on commit 9b8fad5

Please sign in to comment.