[fdo-commits] r2571 - trunk/Providers/GDAL/Src/Provider
svn_fdo at osgeo.org
svn_fdo at osgeo.org
Tue Feb 20 22:24:07 EST 2007
Author: warmerdam
Date: 2007-02-20 22:24:06 -0500 (Tue, 20 Feb 2007)
New Revision: 2571
Modified:
trunk/Providers/GDAL/Src/Provider/FdoRfpDatasetCache.cpp
trunk/Providers/GDAL/Src/Provider/FdoRfpGeoRasterExtractor.cpp
Log:
fix some serious reference counting bugs for datasets (ticket #14)
Modified: trunk/Providers/GDAL/Src/Provider/FdoRfpDatasetCache.cpp
===================================================================
--- trunk/Providers/GDAL/Src/Provider/FdoRfpDatasetCache.cpp 2007-02-20 22:12:31 UTC (rev 2570)
+++ trunk/Providers/GDAL/Src/Provider/FdoRfpDatasetCache.cpp 2007-02-21 03:24:06 UTC (rev 2571)
@@ -114,6 +114,9 @@
// Add our new handle at the beginning of the list.
pahDatasetList[nDatasetCount++] = hDS;
+ // Take a reference on behalf of the caller.
+ GDALReferenceDataset( hDS );
+
return hDS;
}
@@ -155,7 +158,7 @@
for( iDS = nDatasetCount-1; iDS >= 0; iDS-- )
{
GDALReferenceDataset( pahDatasetList[iDS] );
- if( GDALDereferenceDataset( pahDatasetList[iDS] ) == 1 )
+ if( GDALDereferenceDataset( pahDatasetList[iDS] ) <= 1 )
CloseDataset( iDS );
}
}
Modified: trunk/Providers/GDAL/Src/Provider/FdoRfpGeoRasterExtractor.cpp
===================================================================
--- trunk/Providers/GDAL/Src/Provider/FdoRfpGeoRasterExtractor.cpp 2007-02-20 22:12:31 UTC (rev 2570)
+++ trunk/Providers/GDAL/Src/Provider/FdoRfpGeoRasterExtractor.cpp 2007-02-21 03:24:06 UTC (rev 2571)
@@ -187,7 +187,10 @@
// if there is no georeference associated, just ignore this image.
if (FdoRfpRasterUtil::GetGeoReferenceInfo(hDS, geoRef) == false)
+ {
+ datasetCache->UnlockDataset( hDS );
continue;
+ }
datasetCache->UnlockDataset( hDS );
More information about the fdo-commits
mailing list