[Gdal-dev] Reverse the effects of GDALAllRegister()?

Frank Warmerdam warmerdam at pobox.com
Wed Jun 18 19:41:55 EDT 2003


Ben Discoe wrote:

> I am finding a lot of unfreed memory when my program exits.  Tracking it
> down, much of it is allocated in places like:
> 	GDALRegister_FAST()
> 	GDALRegister_FIT() etc.
> Which are called by the usual call to:
> 	GDALAllRegister()
> 
> I looked for, but couldn't find, a way to tell GDAL to "unregister" and
> free all the drivers that it allocates with GDALAllRegister().  There is
> a method GDALDeregisterDriver(), but is only does a single driver and
> doesn't actually free it.
> 
> Do we need a method like GDALAllFree(), or is there already a way to do
> it?

Ben,

Call GDALDestroyDriverManaager().  There are usually a few tiny bits of
stuff left yet (paths pushed on the CPL "finder" stack for instance), but
it should get almost everything.

Best regards,

-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent





More information about the Gdal-dev mailing list