Cleaner registration typically occurs after resources have already been allocated; if an exception occurs before/during the registration of the cleanable the resource may not be freed.
Consider if registration should provide a callback to open the resource after the Cleanable instance has been allocated.
Also previously mentioned during finalization removal in zip.
http://mail.openjdk.java.net/pipermail/core-libs-dev/2018-February/051277.html
Consider if registration should provide a callback to open the resource after the Cleanable instance has been allocated.
Also previously mentioned during finalization removal in zip.
http://mail.openjdk.java.net/pipermail/core-libs-dev/2018-February/051277.html
- relates to
-
JDK-8195059 Update java.net Socket and DatagramSocket implementations to use Cleaner
- Resolved