[vtkusers] BoxWidget + VolumeMapper errors

Mathieu Malaterre mathieu.malaterre at kitware.com
Thu May 27 15:41:07 EDT 2004


David Gobbi wrote:
> Hi Dean,
> 
> The old "GetPlane() always returns the same object" kind of problem
> is pervasive in VTK.
> 
> A vtkPlanes object has exactly one Plane, and when you call GetPlane(i),
> it simply sets the Normal and Origin of that plane as appropriate, and
> then returns it.  This is what caused the problem you were seeing.
> 
> Digging a bit deeper, this problem did not occur in VTK 4.2, since back
> then GetPlane() would create a new plane via vtkPlane::New(), and then
> return that new plane after setting the Origin and Normal.  Of course,
> returning a New'ly created object results in a memory leak.
> 
> The solution would be for vtkPlanes to have a different internal plane
> for each index i (any volunteers?).

Since, I did the mistake of fixing the mem leak, I'll fix it. Thanks for 
the explanation.

http://vtk.org/Bug/bug.php?op=show&bugid=888

Mathieu





More information about the vtkusers mailing list