[OpenJDK 2D-Dev] RFR 8078654: CloseTTFontFileFunc callback should be removed

Andrew Dinn adinn at redhat.com
Thu Apr 30 08:33:33 UTC 2015


On 29/04/15 23:23, Phil Race wrote:
> I think this fix should be fine. There should be no reason
> we need to do anything here as the file should already be
> closed by the Java side which has demonstrably gone away
> so should have already closed the file before then.

That's true and I'm glad to hear this fix will go into jdk9 (and
hopefully 7 and 8). Please let me know if the webrev is ok or you need
any further input.

However, I'll note in passing that the closefn was never there in order
to ensure the JVM closes the file (at least it has been as is for as far
back as I can check the source). The callback looks for some String
memory to free, specifically a char buffer associated with a particular
type of Windows character set -- it trips up because the reference to
the object holding the String returns null. When you investigate the
provenance of the String it turns out that it is always just a normal
String with a normal char buffer -- and therefore the attempt to free
this char buffer is at best misguided. That's the real reason why this
callback is redundant.

regards,


Andrew Dinn
-----------




More information about the 2d-dev mailing list