Skip to content
Permalink
Browse files

Explicitly close gdal dataset handles as early as possible

  • Loading branch information
nyalldawson committed Oct 25, 2017
1 parent 052688c commit 8eb919e5cd73ac4c00e7709794c48665af690a56
Showing with 2 additions and 0 deletions.
  1. +1 −0 src/providers/gdal/qgsgdaldataitems.cpp
  2. +1 −0 src/providers/ogr/qgsogrdataitems.cpp
@@ -311,6 +311,7 @@ QGISEXTERN QgsDataItem *dataItem( QString path, QgsDataItem *parentItem )
}

QStringList sublayers = QgsGdalProvider::subLayers( hDS.get() );
hDS.reset();

QgsDebugMsgLevel( "GdalDataset opened " + path, 2 );

@@ -260,6 +260,7 @@ QList<QgsOgrDbLayerInfo *> QgsOgrLayerItem::subLayers( const QString &path, cons
{
QString uri( QStringLiteral( "%1:%2" ).arg( driver, path ) );
QString name = GDALGetMetadataItem( hDS.get(), "IDENTIFIER", NULL );
hDS.reset();
// Fallback: will not be able to delete the table
if ( name.isEmpty() )
{

0 comments on commit 8eb919e

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