<P>
 Hello everybody,<BR>
 Thanks you all for the help you have done for me.<BR>
 <BR>
 Iam working on a class that uses vtk. the code goes like this<BR>
 <BR>
 //all tehe #includes are here<BR>
 class cdraw<BR>
 {<BR>
 vtkLineSource **ls;<BR>
 vtkPolyDataMapper **map;<BR>
 vtkActor **act;<BR>
 vtkRenderer *rnd;<BR>
 vtkRenderWindowInteractor *rwi;<BR>
 vtkRenderWindow *rw<BR>
 int count;<BR>
 <BR>
 public:<BR>
 cdraw(int cnt)<BR>
 {<BR>
 count=cnt;<BR>
 int i;<BR>
 ls=new vtkLineSource *[cnt];<BR>
 act=new vtkActor *[cnt];<BR>
 map=new vtkPolyDataMapper *[cnt];<BR>
 <BR>
 rnd=vtkRenderer::New();<BR>
 <BR>
 for (i=0;i&lt;cnt;i++)<BR>
 {<BR>
&nbsp; ls[i]=vtkLineSource::New();<BR>
&nbsp; act[i]=vtkActor::New();<BR>
&nbsp; map[i]=vtkPolyDataMapper::New();<BR>
 <BR>
&nbsp; ls[i]-&gt;SetPoint1((float)i,0.0,0.0);<BR>
&nbsp; ls[i]-&gt;SetPoint2((float)i,10.0,0.0);<BR>
&nbsp; map[i]-&gt;SetInput(ls[i]-&gt;GetOutput()); <BR>
&nbsp; act[i]-&gt;SetMapper(map[i]);<BR>
&nbsp; rnd-&gt;AddActor(act[i]);<BR>
 <BR>
 }<BR>
 <BR>
 <BR>
 rw=vtkRenderWindow::New();<BR>
 rw-&gt;AddRenderer(rnd);<BR>
 <BR>
 rwi=vtkRenderWindowInteractor::New();<BR>
 rwi-&gt;SetRenderWindow(rw);<BR>
 <BR>
 }<BR>
 <BR>
 void render()<BR>
 {<BR>
 rwi-&gt;Initialize();<BR>
 rnd-&gt;Render();<BR>
 rwi-&gt;Start();<BR>
 }<BR>
 <BR>
 ~cdraw()<BR>
 {<BR>
&nbsp;  for (i=0;i&lt;cnt;i++)<BR>
&nbsp; {<BR>
&nbsp;  ls[i]-&gt;Delete();<BR>
&nbsp;  act[i]-&gt;Delete();<BR>
&nbsp;  map[i]-&gt;Delete();<BR>
&nbsp; }<BR>
&nbsp; delete[] ls;<BR>
&nbsp; delete[] act;<BR>
&nbsp; delete[] map;<BR>
 <BR>
&nbsp; rnd-&gt;Delete();<BR>
&nbsp; rwi-&gt;Delete();<BR>
&nbsp; rw-&gt;Delete();<BR>
 <BR>
 }<BR>
 <BR>
 };<BR>
 <BR>
 <BR>
 <BR>
 void main()<BR>
 {<BR>
&nbsp;  cdraw *c;<BR>
&nbsp;  c=new cdraw(5);<BR>
&nbsp;  c-&gt;render();<BR>
&nbsp;  <BR>
&nbsp;  delete c;<BR>
}<BR>
<BR>
<BR>
when i exit from the code pressing &quot;q&quot; i get a window which displays the message<BR>
&quot;trying to delete object with non zero refernce count&quot;<BR>
<BR>
please help<BR>
thanking you for the help<BR>
david michell
</P>
<br><br>
<A target="_blank" HREF="http://clients.rediff.com/signature/track_sig.asp"><IMG SRC="http://ads.rediff.com/RealMedia/ads/adstream_nx.cgi/www.rediffmail.com/inbox.htm@Bottom" BORDER=0 VSPACE=0 HSPACE=0 HEIGHT=74 WIDTH=496></a>