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

Momtchil Momtchev momtchil at momtchev.com
Thu Oct 23 05:12:01 PDT 2025


On 23/10/2025 14:09, Even Rouault wrote:
>
>>
>> Ok, if whether its me const_casting or GDAL, this does not change the 
>> basic problem:
>>
>>     Is incrementing the reference counter of a const object an 
>> allowed operation?
>>
> I'd say, if we were purely pedantic, no, but we might decide to 
> derogate from that, with warnings in the documentation. I'm still 
> undecided about the best course of action. I guess I'll talk about 
> that in the maintainer meeting in a few miutes.

What do the Python bindings do when retrieving the SRS of a Dataset? Can 
the user keep this object beyond the lifetime of the Dataset?

-- 
Momtchil Momtchev <momtchil at momtchev.com>



More information about the gdal-dev mailing list