<html>
Hi Francis-<br>
<br>
Some bad mojo here. You've got to register the use of the output
polydata<br>
to make sure the polydata doesn't disappear with the filter. (The output
initially<br>
has a ref count of 1 because the filter is using it; when the filter
disappears it<br>
decrements the ref count and the output disappears.) Also, the
Update()<br>
is usually called on the filter, not the data object.<br>
<br>
Try:<br>
<br>
vtkPolyDataReader *PolyDataReader = vtkPolyDataReader::New();<br>
vtkPolyData *PolyData;<br>
<br>
PolyDataReader-&gt;SetFileName(FileName);<br>
PolyDataReader-&gt;Update();<br>
PolyData = PolyDataReader-&gt;GetOutput();<br>
PolyData-&gt;Register(NULL);<br>
PolyDataReader-&gt;Delete();<br>
printf(&quot;pts read : %d\n&quot;, PolyData-&gt;GetNumberOfPoints()
);<br>
<br>
Will<br>
<blockquote type=cite class=cite cite>
<dl>
<dd>At 06:27 PM 11/14/2000 +0100, you wrote:
<dd>Hello,<br>
<br>

<dd>I'm working with vtk 3.1 on NT4.0 SP4 / Visual C++ 6.0.
<dd>I have problems with memory deallocations.<br>
<br>

<dd>For instance, in the following example, I use a vtkPolyDataReader,
and I
<dd>want to use the resulting vtkPolyData.
<dd>I first get the output of the reader in a temporary vtkPolyData
variable,
<dd>and then I want to deallocate the reader, but if I do so, my
temporary
<dd>variable points a wrong memory place :
</dl></blockquote></html>