[gdal-dev] How to delete shapefile
Mateusz Loskot
mateusz at loskot.net
Wed Jun 17 10:54:18 EDT 2009
Clay, Bruce wrote:
> Frank: Thanks for the information. I tried to update to a newer
> version of GDAL (I tried both 1.6.1 and 1.7.0) but the both crash on
> RegisterAll
>
>
> In both cases the problem seems to be in the following method
>
> void VSIFileManager::InstallHandler( const std::string& osPrefix,
> VSIFilesystemHandler *poHandler )
>
> { if( osPrefix == "" ) Get()->poDefaultHandler = poHandler; else
> Get()->oHandlers[osPrefix] = poHandler; }
>
> The calling methods are passing what appears to be valid strings but
> the osPrefix contents in this method always seem to be different that
> the calling method. One thing that looks odd although it may be
> valid is using std::string as an array index.
The oHandlers is not an array. It is a dictionary implemented using
std::map tree with std::string as key. This is perfectly valid construction.
Try to ensure the following in your own code:
int refCnt = dataSrc->GetSummaryRefCount();
if (refCnt > 0)
{
dataSrc->Release();
}
assert( 0 == dataSrc->GetSummaryRefCount()); // <--- HERE
Cheers,
--
Mateusz Loskot, http://mateusz.loskot.net
More information about the gdal-dev
mailing list