Code like the following on datasets without a palette results in the raster file(s) not
getting closed on connection termination.
FdoPtr?<FdoIRasterPropertyDictionary> propDict = raster->GetAuxiliaryProperties?();
FdoPtr?<FdoDataValue?> pal = propDict->GetProperty?(L"Palette");
It turns out the problem is that FdoRfpRasterPropertyDictionay::GetProperty?() was getting
a reference to an image with m_raster->GetImage?() without ever releasing it again. In fact,
I suppose this was occur for any fetch of a raster property whether it has it or not.
The problem exists in the fdogdal 3.2.0 provider and later.
The following patch fixes the problem in 3.3.0 trunk (and is committed).
The same fix needs to be backpatched to the 3.2.x branch. cc:ing Greg
for instructions on what branch exactly this should go into.
Index: FdoRfpRasterPropertyDictionary.cpp
===================================================================
--- FdoRfpRasterPropertyDictionary.cpp (revision 2551)
+++ FdoRfpRasterPropertyDictionary.cpp (working copy)
@@ -96,7 +96,7 @@
throw FdoException::Create(FdoException::NLSGetMessage(FDO_2_BADPARAMETER, "Bad parameter to method."));
FdoDataValue* rv;
- FdoRfpImage *image = m_raster->GetImage();
+ FdoPtr<FdoRfpImage> image = m_raster->GetImage();
GDALColorTableH hCT = GDALGetRasterColorTable( GDALGetRasterBand( image->GetDS(), image->m_bandList[0] ) );
int numOfEntries = 0;