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

Frank Warmerdam warmerdam at pobox.com
Wed Jun 25 08:49:44 EDT 2003

Ben Discoe wrote:
>>From: Frank Warmerdam
>>>	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().
>>Call GDALDestroyDriverManager().
> Excellent!  Now how about OGR - is there a way to reverse the effects of
> OGRRegisterAll()?  It looks like the following might do the trick:
>  OGRSFDriverRegistrar *reg = OGRSFDriverRegistrar::GetRegistrar();
>  delete reg;
> Is that an advisable way?  A better way?


This is mechanism I use to cleanup in ogrinfo.cpp for finding memory leaks,
so yes it should be OK.

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