On 14/10/2015 14:24, Roger Riggs wrote:
Hi,
Confirmed, the design and implementation encapsulate the cleanup so
it can be run consistently
at-most-once either at close or when it is unreferenced.
It has not been a problem for sun.misc.Cleaner because the cleanup is
*only* done when
the ref is unreachable. But there are issues about latency in getting
resources released and reusable.
There are a few places the in JDK where we do use Cleaner::clean for
exactly this reason.
One thing that I've been wondering about is why the abstract
XXXCleanable classes are public, is that intended?
-Alan.