Fix memory leak in spatialHasing.