Commit 77ec41f3 authored by Will Schroeder's avatar Will Schroeder
Browse files

ERR:Purify memory problem

parent 122fdb55
......@@ -109,15 +109,14 @@ void vtkScalarsToColors::MapScalarsThroughTable(vtkScalars *scalars,
vtkUnsignedCharArray *vtkScalarsToColors::ConvertUnsignedCharToRGBA(
vtkUnsignedCharArray *colors, int numComp, int numTuples)
{
unsigned char *cptr = colors->GetPointer(0);
vtkUnsignedCharArray *newColors = vtkUnsignedCharArray::New();
if ( numComp == 4 && this->Alpha >= 1.0 )
{
newColors->SetArray(cptr, numTuples, 0);
return newColors;
colors->Register(this);
return colors;
}
unsigned char *cptr = colors->GetPointer(0);
vtkUnsignedCharArray *newColors = vtkUnsignedCharArray::New();
newColors->SetNumberOfComponents(4);
newColors->SetNumberOfTuples(numTuples);
unsigned char *nptr = newColors->GetPointer(0);
......
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