[gdal-dev] [gdal 3.12beta1] OGRFeature::GetDefnRef now returns a const pointer

Even Rouault even.rouault at spatialys.com
Tue Oct 21 09:53:07 PDT 2025


Hi,
>
> In GDAL 3.12, OGRFeature::GetDefnRef now returns a const pointer. This 
> means that calling Reference() or Dereference() is no longer possible. 
> Does this mean that this is now automatic?

No. The ref count is modified when creating / destroying the layer (when 
it is linked to a layer), or when creating / destroying features using it.

What would be the use case for manually incrementing/decrementing the 
ref count of a OGRFeatureDefn* returned by OGRFeature::GetDefnRef() ?

Even

-- 
http://www.spatialys.com
My software is free, but my time generally not.



More information about the gdal-dev mailing list