It is documented that nc_free_vlens() works only when the base type of NC_VLEN is an atomic type (excluding NC_STRING), or an NC_ENUM, or an NC_OPAQUE.
(At least that's how I am interpreting this part of the doc, which is a bit confusingly phrased:
WARNING: this code is incorrect because it will only work if the basetype of the vlen is
atomic
+ enum
+ opaque
excluding string basetype,
The reason is that to operate properly, it needs to recurse when the basetype is a complex object such as another vlen or compound.
)
What is the best practice for situations when nc_free_vlens() is not supposed to work? Should calling it be avoided in the cases when we know it won't quite work?
It is documented that nc_free_vlens() works only when the base type of NC_VLEN is an atomic type (excluding NC_STRING), or an NC_ENUM, or an NC_OPAQUE.
(At least that's how I am interpreting this part of the doc, which is a bit confusingly phrased:
)
What is the best practice for situations when nc_free_vlens() is not supposed to work? Should calling it be avoided in the cases when we know it won't quite work?