Skip to content

Commit

Permalink
Doc: OGRLayer::DeleteField(): add note about OGRFieldDefn* life-time
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed Dec 18, 2024
1 parent 3825328 commit 52dc5c6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ogr/ogrsf_frmts/ogrsf_frmts.dox
Original file line number Diff line number Diff line change
Expand Up @@ -2514,6 +2514,10 @@ used by a layer directly.
This method should not be called while there are feature objects in existence that
were obtained or created with the previous layer definition.

If a OGRFieldDefn* object corresponding to the deleted field has been retrieved
from the layer definition before the call to DeleteField(), it must no longer be
used after the call to DeleteField(), which will have destroyed it.

Not all drivers support this method. You can query a layer to check if it supports it
with the OLCDeleteField capability. Some drivers may only support this method while
there are still no features in the layer. When it is supported, the existing features of the
Expand Down Expand Up @@ -2542,6 +2546,10 @@ used by a layer directly.
This function should not be called while there are feature objects in existence that
were obtained or created with the previous layer definition.

If a OGRFieldDefnH object corresponding to the deleted field has been retrieved
from the layer definition before the call to DeleteField(), it must no longer be
used after the call to DeleteField(), which will have destroyed it.

Not all drivers support this function. You can query a layer to check if it supports it
with the OLCDeleteField capability. Some drivers may only support this method while
there are still no features in the layer. When it is supported, the existing features of the
Expand Down

0 comments on commit 52dc5c6

Please sign in to comment.