Skip to content
Snippets Groups Projects
Commit c14d87f8 authored by Sunderlandkyl's avatar Sunderlandkyl
Browse files

Fix crash in vtkPointLocator when number of points is changed to zero

When the number of points in the input dataset was set to zero, BuildLocator would be called but the HashTable would not be invalidated.
The FindClosestPoint methods would continue on with the invalid HashTable, resulting in a crash when invalid point IDs were accessed.

Fixed by calling FreeSearchStructure before returning from BuildLocatorInternal so that the HashTable is invalidated.
FreeSearchStructure now also re-initializes variables that are calculated during BuildLocatorInternal so that Bounds/H/Divisions will be consistent for an empty dataset.
Removed vtkErrorMacro when the dataset is empty or has no points since it is a valid input.
parent d7ac6f01
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment