<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">


<META content="MSHTML 6.00.2800.1106" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Arial size=2><SPAN class=190491313-04092003>I am getting an 
access violation in vtkDataSetMapper. It appears to be a bug. Does anyone have a 
work around?</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=190491313-04092003></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN class=190491313-04092003>Here is the 
constructor for my application class:</SPAN></FONT></DIV>
<DIV><FONT><SPAN class=190491313-04092003>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>CSegViewApp::CSegViewApp()</FONT></DIV>
<DIV><FONT face=Arial size=2>{</FONT></DIV>
<DIV><FONT face=Arial size=2>EnableHtmlHelp();</FONT></DIV>
<DIV><FONT face=Arial size=2>// TODO: add construction code here,</FONT></DIV>
<DIV><FONT face=Arial size=2>// Place all significant initialization in 
InitInstance</FONT></DIV>
<DIV><FONT face=Arial size=2>m_reader=vtkDataSetReader::New();</FONT></DIV>
<DIV><FONT face=Arial size=2>m_mapper=vtkDataSetMapper::New();</FONT></DIV>
<DIV><FONT face=Arial size=2>m_actor=vtkActor::New();</FONT></DIV>
<DIV><FONT face=Arial size=2>m_props=vtkPropCollection::New();</FONT></DIV>
<DIV><FONT face=Arial size=2>m_actor-&gt;SetMapper(m_mapper);</FONT></DIV>
<DIV><FONT face=Arial size=2>m_actor-&gt;VisibilityOff();</FONT></DIV>
<DIV><FONT face=Arial size=2>m_props-&gt;AddItem(m_actor);</FONT></DIV>
<DIV><FONT face=Arial size=2>}</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><SPAN class=190491313-04092003><FONT face=Arial size=2>and here is the 
destructor:</FONT></SPAN></DIV>
<DIV><SPAN class=190491313-04092003><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=190491313-04092003><FONT size=2>&nbsp;</DIV>
<DIV><FONT face=Arial>~CSegViewApp()</FONT></DIV>
<DIV><FONT face=Arial>{</FONT></DIV>
<DIV><FONT face=Arial>m_props-&gt;Delete();</FONT></DIV>
<DIV><FONT face=Arial>m_actor-&gt;Delete();</FONT></DIV>
<DIV><FONT face=Arial>m_reader-&gt;Delete();</FONT></DIV>
<DIV><FONT face=Arial>m_mapper-&gt;Delete(); </FONT></FONT><FONT size=2><FONT 
face=Arial>// access violation on exit</FONT></DIV></FONT><FONT size=2>
<DIV><FONT face=Arial>}</FONT></DIV>
<DIV><FONT face=Arial></FONT></SPAN></FONT>&nbsp;</DIV>
<DIV></SPAN></FONT><SPAN class=190491313-04092003><FONT face=Arial size=2>When 
the destructor executes, m_mapper (a <FONT size=2>vtkDataSetMapper*) calls 
Delete() there is an access violation. Normally with a properly implemented 
reference counting system, the order of destruction shouldn't matter, but I have 
tried deleting these objects in different orders with no 
effect.</FONT></FONT></SPAN></DIV>
<DIV><SPAN class=190491313-04092003><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=190491313-04092003><FONT face=Arial size=2>What do I have to do 
to get m_mapper to delete correctly?</FONT></SPAN></DIV>
<DIV><SPAN class=190491313-04092003><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=190491313-04092003><FONT face=Arial size=2>(I have read in the 
Visualization Toolkit book that Delete() is not required, but without calling 
Delete() a lot of memory is leaked.)</FONT></SPAN></DIV>
<DIV><SPAN class=190491313-04092003><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=190491313-04092003><FONT face=Arial size=2>I can find nothing 
in the documentation about special deletion requirements for this 
class.</FONT></SPAN></DIV>
<P><I><FONT face="Times New Roman" color=#000080 size=4><IMG alt="GE logo" 
src="cid:190491313@04092003-2b61">GE Medical Systems</FONT></I> <BR><FONT 
face="Times New Roman" color=#ff0000 
size=2>_______________________________________________</FONT> <BR><B><FONT 
face=Arial color=#ff6600 size=2>
<MARQUEE scrollAmount=1 scrollDelay=400 direction=down behavior=alternate loop=0 
height=20>John Dubois</MARQUEE></FONT></B><BR><FONT face=Arial color=#ff6600 
size=2>
<MARQUEE scrollAmount=10 scrollDelay=20 behavior=alternate width=350 
loops="0">Software Programmer</MARQUEE></FONT></P>
<P><FONT face=Arial color=#ff6600 size=2>Functional and Molecular Imaging</FONT> 
<BR><FONT face=Arial color=#ff6600 size=2>Phone:&nbsp;519-858-5009</FONT> 
<BR><FONT face=Arial color=#ff6600 size=2>E-mail: <A 
title="Click to send John an e-mail!" 
href="mailto:John.Dubois@med.ge.com?subject=e-mail reply">John.Dubois@med.ge.com</A></FONT> 
</P>
<DIV>&nbsp;</DIV></BODY></HTML>