[gdal-dev] GDALClose()...

Even Rouault even.rouault at spatialys.com
Wed Oct 30 01:42:22 PDT 2019


On mercredi 30 octobre 2019 00:49:24 CET TUELLER, SHAYNE R CIV USAF AFMC 519 
SMXS/MXDEC wrote:
> All,
> 
> We're currently using GDAL 2.3.1 on Windows to develop a shapefile editor
> for our application.
> 
> We're seeing a crash in our application when we call GDALClose() on a
> dataset/layer that contains a large shapefile with a large number of
> polygons. We opened the shapefile and set the dataset by calling
> GDALOpenEx(...).
> 
> When we comment out the GDALClose() call, the application closes the
> dataset/layer without a crash.
> 
> My question is, if we ignore calling GDALClose() to close a layer/dataset,
> will this create a memory leak in our application?

Yes, and if you did changes to the shapefile (as you mention "editor"), then 
the shapefile header will not be updated.
I'd suspect there is a misuse of the GDAL API on your side or some other 
memory corruption. Hard to tell what exactly with just what you mentionned.

Even

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the gdal-dev mailing list