[Gdal-dev] C# Dataset not calling GDALClose()?

Frank Warmerdam warmerdam at pobox.com
Wed Jul 11 10:33:57 EDT 2007


Richard Matsunaga wrote:
> Thanks Tamas, I didn't look deep enough to see what was happening in the C++
> code for Dataset.
> 
> My problem is that our application is an ASP.NET web site and as soon as a
> class instantiates a GDAL or OGR object, the GDAL dll gets locked and is
> only released after some long period of idle time or if iisreset is called.
> This makes updating GDAL (or just republishing the entire website) a bit of
> a pain. I was initially worried that there may be a memory leak in there as
> well, but that seems to not be the case.
> 
> The problem is easily reproduced using NUnit as well. Any test case that
> uses a GDAL resource will lock the GDAL dll as well.
> 
> I just tried calling Ogr.RegisterAll() and it is the cause of the lock on
> the dll. There seems to be no way of releasing resources initialized by
> RegisterAll(). Not surprisingly, this behaviour is also flagged as a memory
> leak (albeit a small one) by DevPartner when using OGR in an application.

Richard / Tamas,

I'm not clear on what this "DLL locking" is all about, but at the C
level there is an OGRCleanupAll() function which will deregister OGR
drivers as well as cleanup some other memory allocations.

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    | President OSGeo, http://osgeo.org




More information about the Gdal-dev mailing list