[vtk-developers] asymmetry of SetNumberOfComponents and SetNumberOfTuples

Michael Halle mhalle at bwh.harvard.edu
Thu Apr 22 12:46:28 EDT 2004


Today I got burned by the fact that if you have
a data array and you call

SetNumberOfComponents, then
SetNumberOfTuples

everything is fine, but

SetNumberOfTuples, then
SetNumberOfComponents

will cause a core dump for ntuples > 1.

Turns out that SetNumberOfTuples does the allocation,
while NumberOfComponents is just an ivar.

This seems like it would be a pretty common "gotcha":
shouldn't both allocate or reallocate as needed?

(Yes, this behavior is sort of documented, but that's not
the point.)

Michael Halle
mhalle at bwh.harvard.edu




More information about the vtk-developers mailing list