[gdal-dev] Question on OGR handle types
stefan.moebius at actix.com
Wed Aug 5 11:59:01 EDT 2009
In May 2008, a couple of changes where made to improve type checking.
Our code is using the function
(OGRSpatialReference * poSource,
OGRSpatialReference * poTarget)
and with the upgrade from 1.5 to 1.6, we now cannot properly destroy the
OGRCoordinateTransformation anymore (at least in debug mode).
The documentation of that create function says:
> Create transformation object.
> This is the same as the C function OCTNewCoordinateTransformation().
> Input spatial reference system objects are assigned by copy (calling clone() method) and no ownership transfer occurs.
> The delete operator, or OCTDestroyCoordinateTransformation() should be used to destroy transformation objects.
As we are linking the GDAL dynamically, using delete is not really an option
as we cannot predict what heap was used to create the object. The destroy
function, however, requires a parameter of type
OGRCoordinateTransformationH, which we cannot cleanly cast to anymore for
that change mentioned at the beginning.
What are we missing here? How is this supposed to be used?
Any help is appreciated.
T +49 351 40429 17
More information about the gdal-dev