Commit 0308f051 authored by Francois Bertel's avatar Francois Bertel
Browse files

Made SetAttributeCollection ready for a null input argument

parent 0cb2515f
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#include "vtkGenericAttributeCollection.h" #include "vtkGenericAttributeCollection.h"
#include "vtkGenericAdaptorCell.h" #include "vtkGenericAdaptorCell.h"
vtkCxxRevisionMacro(vtkGenericSubdivisionErrorMetric,"1.2"); vtkCxxRevisionMacro(vtkGenericSubdivisionErrorMetric,"1.3");
vtkStandardNewMacro(vtkGenericSubdivisionErrorMetric); vtkStandardNewMacro(vtkGenericSubdivisionErrorMetric);
vtkCxxSetObjectMacro(vtkGenericSubdivisionErrorMetric, GenericCell,vtkGenericAdaptorCell); vtkCxxSetObjectMacro(vtkGenericSubdivisionErrorMetric, GenericCell,vtkGenericAdaptorCell);
...@@ -54,9 +54,18 @@ void vtkGenericSubdivisionErrorMetric::SetAttributeCollection(vtkGenericAttribut ...@@ -54,9 +54,18 @@ void vtkGenericSubdivisionErrorMetric::SetAttributeCollection(vtkGenericAttribut
delete[] this->Edge1Cache; delete[] this->Edge1Cache;
delete[] this->Edge2Cache; delete[] this->Edge2Cache;
} }
int numComp = this->AttributeCollection->GetNumberOfComponents();
this->Edge1Cache = new double[numComp+3]; if(this->AttributeCollection!=0)
this->Edge2Cache = new double[numComp+3]; {
int numComp = this->AttributeCollection->GetNumberOfComponents();
this->Edge1Cache = new double[numComp+3];
this->Edge2Cache = new double[numComp+3];
}
else
{
this->Edge1Cache = 0;
this->Edge2Cache = 0;
}
} }
......
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