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

Clang's AddressSanitizer throws an alloc-dealloc-mismatch (operator
new[] vs free) error here.
pull/7628/head
Sergiu Deitsch 8 years ago
parent d1bbc0b6e6
commit d4b501e734
  1. 2
      modules/viz/src/precomp.hpp
  2. 2
      modules/viz/src/vtk/vtkCloudMatSource.cpp

@ -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;
}

@ -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>

Loading…
Cancel
Save