Skip to content
Permalink
Browse files
Prevent concurrent wfs iterators for now
  • Loading branch information
mhugent committed Jan 21, 2013
1 parent c5ed2cf commit 8e2262b64bf6506257bd5993d34529f6f05d0d87
Showing with 18 additions and 1 deletion.
  1. +13 −1 src/providers/wfs/qgswfsfeatureiterator.cpp
  2. +5 −0 src/providers/wfs/qgswfsprovider.cpp
@@ -12,6 +12,12 @@ QgsWFSFeatureIterator::QgsWFSFeatureIterator( QgsWFSProvider* provider, const Qg
return;
}

if ( mProvider->mActiveIterator )
{
mProvider->mActiveIterator->close();
}
mProvider->mActiveIterator = this;

switch ( request.filterType() )
{
case QgsFeatureRequest::FilterRect:
@@ -67,5 +73,11 @@ bool QgsWFSFeatureIterator::rewind()

bool QgsWFSFeatureIterator::close()
{
return false;
if ( !mProvider )
{
return false;
}
mProvider->mActiveIterator = 0;
mProvider = 0;
return true;
}
@@ -50,6 +50,7 @@ static const QString GML_NAMESPACE = "http://www.opengis.net/gml";
QgsWFSProvider::QgsWFSProvider( const QString& uri )
: QgsVectorDataProvider( uri ),
mNetworkRequestFinished( true ),
mActiveIterator( 0 ),
mRequestEncoding( QgsWFSProvider::GET ),
mUseIntersect( false ),
mWKBType( QGis::WKBUnknown ),
@@ -123,6 +124,10 @@ QgsWFSProvider::~QgsWFSProvider()
{
deleteData();
delete mSpatialIndex;
if ( mActiveIterator )
{
mActiveIterator->close();
}
}

void QgsWFSProvider::reloadData()

0 comments on commit 8e2262b

Please sign in to comment.