Skip to content
Permalink
Browse files

Avoid deep copy of spatial index when features are fetched on

main thread
  • Loading branch information
nyalldawson committed Feb 9, 2018
1 parent 50a8813 commit 426c72f28a0545aa1704c14d1b4d33aa337c1848
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/core/providers/memory/qgsmemoryfeatureiterator.cpp
@@ -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();
}

0 comments on commit 426c72f

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