Changes between Version 3 and Version 4 of PythonGotchas


Ignore:
Timestamp:
Sep 20, 2010, 9:24:58 AM (14 years ago)
Author:
jjr8
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • PythonGotchas

    v3 v4  
    107107The advantage of the "Ref" and "Directly" functions is they provide faster performance because a duplicate object does not need to be created. The disadvantage is that you have to watch out for this problem.
    108108
    109 The examples above are based on [http://lists.osgeo.org/pipermail/gdal-dev/2010-September/026027.html email from Even Rouault].
     109The information above is based on [http://lists.osgeo.org/pipermail/gdal-dev/2010-September/026027.html email from Even Rouault].
     110
     111=== Python crashes if you add a new field to an OGR layer when features deriving from this layer definition are still active ===
     112
     113For example:
     114
     115{{{
     116>>> feature = lyr.GetNextFeature()
     117>>> field_defn = ogr.FieldDefn("foo", ogr.OFTString)
     118>>> lyr.CreateField(field_defn)                       # now, existing features deriving from this layer are invalid
     119>>> feature.DumpReadable()                            # segfault
     120< Python crashes >
     121}}}
     122
     123For more information, please see #3552.
    110124
    111125=== Certain objects contain a {{{Destroy()}}} method, but you should never use it ===