Commit 4f3097f0 authored by Utkarsh Ayachit's avatar Utkarsh Ayachit

Fixed a segfault when quitting paraview.

There was a segfault when quitting paraview due to accessing of dangling
pointers. fixed that.
parent 81f9644d
......@@ -114,7 +114,18 @@ vtkSMProxyProperty::vtkSMProxyProperty()
//---------------------------------------------------------------------------
vtkSMProxyProperty::~vtkSMProxyProperty()
{
delete this->PPInternals;
// Ensure that this happens before we delete this->PPInternals. This is needed
// because when items in this vector are being destroyed, they call
// vtkSMProxyProperty::RemoveProducer(). That function uses this->PPInternals
// to update producer counts.
this->PPInternals->Proxies.clear();
// We use this indirection to detect any other issues we may run into when
// destroying the vtkSMProxyPropertyInternals instance more
// cleanly (since we'll be accessing a NULL ptr).
vtkSMProxyPropertyInternals* temp = this->PPInternals;
this->PPInternals = NULL;
delete temp;
}
//---------------------------------------------------------------------------
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment