GDALDestroyDriverManager() and static driver pointers

Frank Warmerdam warmerdam at p...
Wed Sep 4 03:04:03 EDT 2002


Folks,

I have implemented GDALDestroyDriverManager() in response to the request 
for a way to
cleanup loaded drivers. However, to make it work smoothly, such that 
drivers can be reloaded
properly with a GDALAllRegister() call after destroying the driver 
manager, it is important that
we no longer maintain static driver pointers within out driver 
implementations.

In the past each driver maintained a static pointer to its GDALDriver 
instance. The problem
with this is that this doesn't get "NULLed" when the driver is 
destroyed. So, to fix do the
following steps to any drivers not in CVS (I have fixed all these):

o Remove the static pointer.
o Remove any initialization of the poDriver pointer in the GDALDataset. 
This will be taken
care of by GDALOpen().
o Change your register function to check if the driver is already 
loaded by calling
GDALGetDriverByName().

Best regards,

-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up | Frank Warmerdam, warmerdam at p...
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