Skip to content

Commit

Permalink
Avoid deep copy of spatial index when features are fetched on
Browse files Browse the repository at this point in the history
main thread
  • Loading branch information
nyalldawson committed Feb 9, 2018
1 parent 50a8813 commit 426c72f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/providers/memory/qgsmemoryfeatureiterator.cpp
Expand Up @@ -240,7 +240,7 @@ QgsMemoryFeatureSource::QgsMemoryFeatureSource( const QgsMemoryProvider *p )
mExpressionContext.setFields( mFields );

// QgsSpatialIndex is not thread safe - so make spatial index safe to use across threads by forcing a full deep copy
if ( mSpatialIndex )
if ( mSpatialIndex && p->thread() != QThread::currentThread() )
mSpatialIndex->detach();
}

Expand Down

0 comments on commit 426c72f

Please sign in to comment.