[Gdal-dev] Re: OGRFeatureDefn and OGRSpatialReference Reference Counting Semantics Now Honoured

Charlie Savage cfis at interserv.com
Wed Sep 21 03:46:58 EDT 2005


Thanks Frank - this will make the script bindings much more stable and
easier to work with.

I've tested the changes using the Ruby unit tests that I did to check 
for this problem and they now all work!

Charlie


Frank Warmerdam wrote:
> Folks,
> 
> In the past most OGR drivers were very callous about destroying
> their own OGRFeatureDefn's and OGRSpatialReferences despite the
> fact that these classes have reference counting semantics. 
> 
> The net outcome of this was that it was impossible, for instance, to 
> keep an OGRFeature alive after the corresponding layer had been
> destroyed because the OGRLayer would go and destroy the OGRFeatureDefn
> it shared with the feature even though the feature still had a reference on it.
> 
> I have gone through all the drivers in CVS and tried to fix this up.  The
> test suite passes and I did indepth tests of many drivers with ogrinfo
> and valgrind to verify things were being cleaned up properly, but I do
> think the OGR should be considered a bit unstable at this time.   So
> caveat emptor or be careful or something like that. 
> 
> Let me know if you run into problems. 
> 
> This should fix at least one class of problems coming up in the script
> bindings. 
> 
> Best regards,





More information about the Gdal-dev mailing list