Commit fc54ca2b authored by Ken Martin's avatar Ken Martin
Browse files

fix a problem where the input and output ports were being deleted too early....

fix a problem where the input and output ports were being deleted too early. We want to delete the connections but leave the arrays
parent faae992f
......@@ -29,7 +29,7 @@
#include <vtkstd/set>
#include <vtkstd/vector>
vtkCxxRevisionMacro(vtkAlgorithm, "1.17");
vtkCxxRevisionMacro(vtkAlgorithm, "1.18");
vtkStandardNewMacro(vtkAlgorithm);
vtkCxxSetObjectMacro(vtkAlgorithm,Information,vtkInformation);
......@@ -734,8 +734,19 @@ void vtkAlgorithm::GarbageCollectionStarting()
void vtkAlgorithm::RemoveReferences()
{
this->AlgorithmInternal->Executive = 0;
this->AlgorithmInternal->InputPorts.clear();
this->AlgorithmInternal->OutputPorts.clear();
// Remove all connection-related references without clearing the ports
// array. The destructor of a subclass may still need to access the number
// of input or output ports.
int i;
for(i=0; i < this->GetNumberOfInputPorts(); ++i)
{
this->AlgorithmInternal->InputPorts[i].clear();
}
for(i=0; i < this->GetNumberOfOutputPorts(); ++i)
{
this->AlgorithmInternal->OutputPorts[i].clear();
}
this->Superclass::RemoveReferences();
}
......
Supports Markdown
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