[gdal-dev] GDALDestroyDriverManager() - dataset cleanup

Even Rouault even.rouault at mines-paris.org
Wed Feb 9 17:07:23 EST 2011


Le mercredi 09 février 2011 03:31:34, Frank Warmerdam a écrit :
> Folks,
> 
> I have modified GDALDriverManager::~GDALDriverManager() so that when
> it is destroyed it will first close all still-open GDAL datasets.  A debug
> message will be issued for each dataset force-closed.
> 
> This is part of an effort to ensure a clean shutdown and to make it easier
> to detect memory leaks in some situations.
> 
> This is not a completely safe operation.  In particular, if there are VRT
> files referencing other GDALDataset's the referenced dataset may be cleaned
> up before the referencing dataset which would be bad.
> 

I have found and implemented a -hopefully- safer way of closing the datasets, 
by asking them first to kindly release all references to other datasets they 
might still have. After that, it is safe to call GDALClose() on the remaining 
opened datasets. See ticket http://trac.osgeo.org/gdal/ticket/3954 for the 
details


More information about the gdal-dev mailing list