Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Revert "GDAL/OGR mutex in data items on GDALOpen/OGROpen"
This reverts commit 9ebb24e.
  • Loading branch information
blazek committed Jul 3, 2015
1 parent 9ebb24e commit a214a9c
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 26 deletions.
9 changes: 0 additions & 9 deletions src/providers/gdal/qgsgdaldataitems.cpp
Expand Up @@ -22,9 +22,6 @@
// defined in qgsgdalprovider.cpp
void buildSupportedRasterFileFilterAndExtensions( QString & theFileFiltersString, QStringList & theExtensions, QStringList & theWildcards );

#ifndef SPATIALITE_VERSION_G_4_1_1
QMutex QgsGdalLayerItem::sMutex;
#endif

QgsGdalLayerItem::QgsGdalLayerItem( QgsDataItem* parent,
QString name, QString path, QString uri,
Expand All @@ -42,12 +39,6 @@ QgsGdalLayerItem::QgsGdalLayerItem( QgsDataItem* parent,
else
setState( Populated );

// If GDAL is compiled with SpatiaLite <= 4.1.1, GDALOpen results in call to spatialite_init()
// which is nopt thread safe, see http://lists.osgeo.org/pipermail/qgis-developer/2015-June/038392.html
#ifndef SPATIALITE_VERSION_G_4_1_1
QgsDebugMsg( "lock" );
QMutexLocker locker( &sMutex );
#endif
GDALAllRegister();
GDALDatasetH hDS = GDALOpen( TO8F( mPath ), GA_Update );

Expand Down
3 changes: 0 additions & 3 deletions src/providers/gdal/qgsgdaldataitems.h
Expand Up @@ -22,9 +22,6 @@ class QgsGdalLayerItem : public QgsLayerItem
private:

QStringList sublayers;
#ifndef SPATIALITE_VERSION_G_4_1_1
static QMutex sMutex;
#endif

public:
QgsGdalLayerItem( QgsDataItem* parent,
Expand Down
10 changes: 0 additions & 10 deletions src/providers/ogr/qgsogrdataitems.cpp
Expand Up @@ -30,9 +30,6 @@
QGISEXTERN QStringList fileExtensions();
QGISEXTERN QStringList wildcards();

#ifndef SPATIALITE_VERSION_G_4_1_1
QMutex QgsOgrLayerItem::sMutex;
#endif

QgsOgrLayerItem::QgsOgrLayerItem( QgsDataItem* parent,
QString name, QString path, QString uri, LayerType layerType )
Expand All @@ -43,13 +40,6 @@ QgsOgrLayerItem::QgsOgrLayerItem( QgsDataItem* parent,

OGRRegisterAll();
OGRSFDriverH hDriver;

// If GDAL is compiled with SpatiaLite <= 4.1.1, GDALOpen results in call to spatialite_init()
// which is nopt thread safe, see http://lists.osgeo.org/pipermail/qgis-developer/2015-June/038392.html
#ifndef SPATIALITE_VERSION_G_4_1_1
QgsDebugMsg( "lock" );
QMutexLocker locker( &sMutex );
#endif
OGRDataSourceH hDataSource = OGROpen( TO8F( mPath ), true, &hDriver );

if ( hDataSource )
Expand Down
4 changes: 0 additions & 4 deletions src/providers/ogr/qgsogrdataitems.h
Expand Up @@ -29,10 +29,6 @@ class QgsOgrLayerItem : public QgsLayerItem
bool setCrs( QgsCoordinateReferenceSystem crs ) override;
Capability capabilities() override;
QString layerName() const override;
private:
#ifndef SPATIALITE_VERSION_G_4_1_1
static QMutex sMutex;
#endif
};

class QgsOgrDataCollectionItem : public QgsDataCollectionItem
Expand Down

0 comments on commit a214a9c

Please sign in to comment.