<div>Hi all,</div>
<div>I have the following bug which I hope that someone can help me to solve it...</div>
<div>I&#39;m using a loop that contains</div>
<div> </div>
<div><font size="2">vtkBMPReader* bmpreader = vtkBMPReader::New();</font></div>
<div><font size="2"><font size="2">bmpreader-&gt;SetFileName(FileName);</font></font></div>
<div><font size="2"><font size="2"><font size="2">vtkImageShrink3D* shrink3D = vtkImageShrink3D::New();</font></font></font></div>
<div><font size="2"><font size="2"><font size="2">shrink3D-&gt;SetInputConnection(bmpreader-&gt;GetOutputPort());</font></font></font></div>
<div><font size="2"><font size="2"><font size="2">shrink3D-&gt;SetAveraging(1);</font></font></font></div>
<div><font size="2"><font size="2"><font size="2"><font size="2">shrink3D-&gt;Update();                                          // Error</font></font></font></font></div>
<div><font size="2"><font size="2"><font size="2"><font size="2"><font size="2">vtkImageMapToColors* map = vtkImageMapToColors::New();</font></font></font></font></font></div>
<div><font size="2"><font size="2"><font size="2"><font size="2"><font size="2"><font size="2">map-&gt;SetInputConnection(shrink3D-&gt;GetOutputPort());</font></font></font></font></font></font></div>
<div><font size="2"><font size="2"><font size="2"><font size="2"><font size="2"><font size="2"><font size="2">map-&gt;Update();                                                // Error</font></font></font></font></font></font></font></div>

<div>....................</div>
<div><font size="2">map-&gt;Delete();</font></div>
<div><font size="2">bmpreader-&gt;Delete();</font></div>
<div><font size="2">shrink3D-&gt;Delete();</font></div>
<p>After repeating the loop for many times, I&#39;m getting the following error exactly at the Updat() lines</p><font size="1">
<p><font size="2">First-chance exception at 0x01cc4c0c in Program.exe: 0xC0000005: Access violation writing location 0x00000000.</font></p>
<p><font size="2">A first chance exception of type &#39;System.AccessViolationException&#39; occurred in Program.exe</font> </p>
<p><font size="2">Waiting for your advice..</font></p>
<p><font size="2">BS</font></p></font>