#3871 closed defect (fixed)
GDALGetOpenDatasets broken (1.7 and 1.8dev)
Reported by: | warmerdam | Owned by: | warmerdam |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | GDAL_Raster | Version: | svn-trunk |
Severity: | normal | Keywords: | |
Cc: |
Description
The method GDALDataset::GetOpenDatasets() is broken and returns a list of pointers to things that are *not* datasets. This bug was discovered in GDAL svn trunk and it also appears to exist in 1.7.
Change History (4)
comment:1 by , 13 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:2 by , 12 years ago
Actually, since the dataset handle was inserted into a hashlist at the time of GDAL 1.6.0. But to fix #2897, the dataset handle was not any longer inserted, but it was a structure instead (r16616). I realized a bit later that it broke GDALDumpOpenSharedDataset(), which was fixed in 16983. But I didn't realize that GDALDataset::GetOpenDatasets() was affected (as I think it isn't used by any GDAL utility, I didn't notice...) So GDAL 1.6.X where X >=1 is also affected and your fix would be theoretically necessary there too.
After closer review of all use of phAllDatasetSet in gdaldataset.cpp, after your fix, I'm pretty confident we're OK as far as the use of phAllDatasetSet is concerned.
Corrected in trunk (r21209) and 1.7 branch (r21210).
Basically I assume this function has been completely broken since things were reworked to use a hash list for the open dataset list. It is rarely used and so apparently no one has noticed.