JEP-421 slates finalize to be removed and this ticket tracks those removals from the JDK in full. JEP-421 recommends using try-with-resources and/or cleaners and phantomrefs to deal with memory problems. This is an issue to figure out solutions to that upcoming problem.
try-with-resource: we already do that- CvMat adds try-with-resources to OpenCV's mat. Finalize is used as a development aid to track resource leaks. This is a thread to talk about what to do.
I have done almost no work on coming up with a solution but some avenues of approach could be to:
tie the ability of a CvMat to access memory at all into PileCV's closer. This adds a tight coupling but since the alternative is a possible resource leak, maybe that's okay?
JEP-421 slates finalize to be removed and this ticket tracks those removals from the JDK in full. JEP-421 recommends using try-with-resources and/or cleaners and phantomrefs to deal with memory problems. This is an issue to figure out solutions to that upcoming problem.
try-with-resource: we already do that- CvMat adds try-with-resources to OpenCV's mat. Finalize is used as a development aid to track resource leaks. This is a thread to talk about what to do.
I have done almost no work on coming up with a solution but some avenues of approach could be to: