[Gdal-dev] Registering a format driver at run-time

Frank Warmerdam warmerdam at pobox.com
Mon Feb 13 19:43:50 EST 2006


Peng Gao wrote:
>> Could you try commenting out the following two lines?
>>
>>              if( --poUnderlyingIOStream->nFileViewCount == 0 )
>>                  delete poUnderlyingIOStream;
>>
> 
> I tried and it didn't make any difference. 
> 
> One solution for the wrong heap context is to
> destroy the dataset in the dll where it comes from.
> Instead of deleting a dataset in GDALClose or directly in an app, each
> driver
> will provide matching Close() function that deletes/releases the dataset
> returned from Open()/Create().
> 
> I think AutoLoadDrivers() will have similar problem.

Gao,

Actually, I was thinking the problem might be between the ECW driver
and the underlying ECW SDK, not between the GDAL or application DLL
and the GDAL driver plugin.   But any of those *could* be an issue.

Indeed, calling GDALClose() is the application is generally preferred
to invoking delete directly on a dataset pointer for the reason given.

You might want to try commenting out the "delete poFileView" too, and
see if that happens.

What version of the ECW SDK are you using?  I think I may need to try
and reproduce the problem.

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