diff --git a/plugins/input/gdal/gdal_datasource.cpp b/plugins/input/gdal/gdal_datasource.cpp index ae4e44a5a..05835a9da 100644 --- a/plugins/input/gdal/gdal_datasource.cpp +++ b/plugins/input/gdal/gdal_datasource.cpp @@ -43,6 +43,7 @@ gdal_datasource::gdal_datasource(parameters const& params) desc_(*params.get("type"),"utf-8") { GDALAllRegister(); + boost::optional file = params.get("file"); if (!file) throw datasource_exception("missing parameter"); @@ -64,7 +65,11 @@ gdal_datasource::gdal_datasource(parameters const& params) extent_.init(x0,y0,x1,y1); } -gdal_datasource::~gdal_datasource() {} +gdal_datasource::~gdal_datasource() +{ + GDALDereferenceDataset (dataset_.get()); + dataset_.reset(); // prevent delete of dataset +} int gdal_datasource::type() const {