ReleaseGraphicsResources query

Tim Hutton T.Hutton at eastman.ucl.ac.uk
Wed May 31 09:43:22 EDT 2000


To follow up the last post, it is indeed possible to avoid the access
violation (seg faulting) by calling ReleaseGraphicsResources(). If I can
suggest the following change in vtkMFCRenderView.cxx. (To repeat, would be
nice to have these files in the CVS repository)

vtkMFCRenderView::~vtkMFCRenderView()
{
	if (this->Interactor) this->Interactor->Delete();
	if (this->RenderWindow) 
	{
		// need to release the render window's graphics resource before deleting it
		vtkMFCDocument* pDoc = (vtkMFCDocument*)GetDocument();
		ASSERT_VALID(pDoc);
		pDoc->Props->InitTraversal();
		vtkProp *pProp;
		while((pProp = pDoc->Props->GetNextProp())!=NULL)
			pProp->ReleaseGraphicsResources(this->RenderWindow); 

		this->RenderWindow->Delete();
	}
	if (this->Renderer) this->Renderer->Delete();
}

Cheers,

Tim.
---------------------------------------------------------------------------
Tim Hutton, Research Assistant,    http://www.eastman.ucl.ac.uk/~dmi/MINORI
MINORI Project,                           Email: T.Hutton at eastman.ucl.ac.uk
Informatics Unit (Media Centre),      Permanent: T.Hutton at mail.com
Eastman Dental Institute, UCL,                        Tel: +44 20 7915 2344
256 Gray's Inn Road, London WC1X 8LD, UK              Fax: +44 20 7915 2303
---------------------------------------------------------------------------
This email represents the views of the sender alone and must not be
construed as representing the views of the Eastman Dental Institute. It may
contain confidential information and may be protected by law as a legally
privileged document and copyright work. Its content should not be disclosed
and it should not be given or copied to anyone other than the person(s)
named or referenced above. If you have received this email in error, please
contact the sender.





More information about the vtk-developers mailing list