From 7532000706ecdfbda115744b3f31ceead124e869 Mon Sep 17 00:00:00 2001 From: Martin Dobias Date: Fri, 26 Jun 2015 18:04:25 +0800 Subject: [PATCH] Data items: Close GDAL dataset when it is not needed This was leading to situations where QGIS was hitting limit of the maximum open files --- src/providers/gdal/qgsgdaldataitems.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/providers/gdal/qgsgdaldataitems.cpp b/src/providers/gdal/qgsgdaldataitems.cpp index ea0c450f92f..be83e0df38a 100644 --- a/src/providers/gdal/qgsgdaldataitems.cpp +++ b/src/providers/gdal/qgsgdaldataitems.cpp @@ -43,7 +43,10 @@ QgsGdalLayerItem::QgsGdalLayerItem( QgsDataItem* parent, GDALDatasetH hDS = GDALOpen( TO8F( mPath ), GA_Update ); if ( hDS ) + { mCapabilities |= SetCrs; + GDALClose( hDS ); + } } QgsGdalLayerItem::~QgsGdalLayerItem()