[vtkusers] Access violation in vtkDataSetMapper

Dubois, John R (MED) John.Dubois at med.ge.com
Thu Sep 4 09:25:05 EDT 2003


I am getting an access violation in vtkDataSetMapper. It appears to be a
bug. Does anyone have a work around?
 
Here is the constructor for my application class:
 
CSegViewApp::CSegViewApp()
{
EnableHtmlHelp();
// TODO: add construction code here,
// Place all significant initialization in InitInstance
m_reader=vtkDataSetReader::New();
m_mapper=vtkDataSetMapper::New();
m_actor=vtkActor::New();
m_props=vtkPropCollection::New();
m_actor->SetMapper(m_mapper);
m_actor->VisibilityOff();
m_props->AddItem(m_actor);
}
 
and here is the destructor:
 
 
~CSegViewApp()
{
m_props->Delete();
m_actor->Delete();
m_reader->Delete();
m_mapper->Delete(); // access violation on exit
}
 
When the destructor executes, m_mapper (a 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.
 
What do I have to do to get m_mapper to delete correctly?
 
(I have read in the Visualization Toolkit book that Delete() is not
required, but without calling Delete() a lot of memory is leaked.)
 
I can find nothing in the documentation about special deletion
requirements for this class.

GE logoGE Medical Systems 
_______________________________________________ 
John Dubois
Software Programmer

Functional and Molecular Imaging 
Phone: 519-858-5009 
E-mail: John.Dubois at med.ge.com
<mailto:John.Dubois at med.ge.com?subject=e-mail reply>  

 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20030904/498aed89/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: John R Dubois (MED) (E-mail).vcf
Type: application/octet-stream
Size: 359 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20030904/498aed89/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: GE48.gif
Type: image/gif
Size: 1151 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20030904/498aed89/attachment.gif>


More information about the vtkusers mailing list