[gdal-dev] FW: Problem with GDAL perl 1.5 bindings
Ari Jolma
ari.jolma at tkk.fi
Fri Feb 1 09:31:56 EST 2008
Ethan Alpert kirjoitti:
> Ari,
>
> I believe reference counts can be manipulated in perlguts. Would it be
> possible to undef any rasterband variables referencing stale/orphaned
> raster bands when the parent dataset is destroyed/dereferenced?
That could be possible. At least it might be possible to invalidate the
rasterband object somehow. (but see below)
> This would allow for perl to exit with a perl error rather than dumping core
> as well wouldn't it?
>
> Is there any use of a rasterband that has no parent dataset?
>
No.
> If not then trying to use it after it's dataset is destroyed and no
> other datasets reference it would be a programming error and the perl
> "Can't call method "WriteRaster" on an undefined value at ./test.pl line
> 10", for instance, would be very appropriate and much more informative
> than a core dump. It would also be a better outcome than producing a
> bogus tiff.IMHO
>
Yes, but the objects in Geo::GDAL are just references to the C++ or C
pointers in the wrappers. At the point when the destruction of a Dataset
is happening we do have such a reference to the (possible) RasterBand
pointers. So, we could do something with it, but as it is only a pointer
(as I believe), the real invalidation should happen in GDAL proper,
which does not have any mechanism for it -- and I guess Frank's not very
keen on providing one. ;)
Ari
--
Prof. Ari Jolma
Geoinformatiikka / Geoinformatics
Teknillinen Korkeakoulu / Helsinki University of Technology
tel: +358 9 451 3886 address: POBox 1200, 02015 TKK, Finland
Email: ari.jolma at tkk.fi URL: http://www.tkk.fi/~jolma
More information about the gdal-dev
mailing list