viz: free new[] allocated arrays using delete[] instead of free

Clang's AddressSanitizer throws an alloc-dealloc-mismatch (operator
new[] vs free) error here.
This commit is contained in:
Sergiu Deitsch 2016-11-08 12:54:58 +01:00
parent d1bbc0b6e6
commit d4b501e734
2 changed files with 2 additions and 2 deletions

View File

@ -282,7 +282,7 @@ namespace cv
scalars->SetName("Colors");
scalars->SetNumberOfComponents(3);
scalars->SetNumberOfTuples((vtkIdType)size);
scalars->SetArray(color_data->val, (vtkIdType)(size * 3), 0);
scalars->SetArray(color_data->val, (vtkIdType)(size * 3), 0, vtkUnsignedCharArray::VTK_DATA_ARRAY_DELETE);
return scalars;
}

View File

@ -235,7 +235,7 @@ void cv::viz::vtkCloudMatSource::filterNanColorsCopy(const Mat& cloud_colors, co
scalars->SetName("Colors");
scalars->SetNumberOfComponents(3);
scalars->SetNumberOfTuples(total);
scalars->SetArray(array->val, total * 3, 0);
scalars->SetArray(array->val, total * 3, 0, vtkUnsignedCharArray::VTK_DATA_ARRAY_DELETE);
}
template<typename _Tn, typename _Msk>