Release locks in ArrayHandleVirtual control portals
This fixes an issue where getting a ReadPortal
or a WritePortal
from
an ArrayHandleVirtual
could cause a deadlock from a held token even if
the returned portal was detached or destroyed.
The problem was that ArrayHandleVirtual
was keeping a reference to the
ArrayPortal
from the concrete array. This was because the returned
ArrayPortalRef
, which was designed to work on both control and
execution environments, had no good way to destroy the portal. This
meant that the ArrayHandleVirtual
was caching a copy of the concrete
array's portal. This was not a great idea before because the array could
get invalidated. It is worse now because it keeps the concrete array
locked.
Fixed the problem by subclassing vtkm::ArrayPortalRef
to make a
control-specific version that will delete the concrete portal on its own
destruction.