Skip to content

Commit

Permalink
"[GDAL provider] Set VRT_SHARED_SOURCE=NO configuration option by def…
Browse files Browse the repository at this point in the history
…ault (#16507)

This will avoid crashes with VRT datasets in multi-threaded use.
  • Loading branch information
rouault committed Jun 26, 2017
1 parent a603bdf commit d6e7ec6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/providers/gdal/qgsgdalprovider.cpp
Expand Up @@ -146,6 +146,14 @@ QgsGdalProvider::QgsGdalProvider( const QString &uri, bool update )
CPLSetConfigOption( "AAIGRID_DATATYPE", "Float64" );
}

if ( !CPLGetConfigOption( "VRT_SHARED_SOURCE", nullptr ) )
{
// GDAL version up to this date have issues will use of VRT in multi-threaded
// scenarios. See https://issues.qgis.org/issues/16507 /
// https://trac.osgeo.org/gdal/ticket/6939
CPLSetConfigOption( "VRT_SHARED_SOURCE", "NO" );
}

// To get buildSupportedRasterFileFilter the provider is called with empty uri
if ( uri.isEmpty() )
{
Expand Down

0 comments on commit d6e7ec6

Please sign in to comment.