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

Frank Warmerdam warmerdam at pobox.com
Tue Sep 20 21:20:01 EDT 2005


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,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent




More information about the Gdal-dev mailing list