RFR: 8284680: sun.font.FontConfigManager.getFontConfig() leaks charset

Zhengyu Gu zgu at openjdk.java.net
Thu Apr 28 20:16:45 UTC 2022


On Mon, 11 Apr 2022 18:05:09 GMT, Zhengyu Gu <zgu at openjdk.org> wrote:

> Please review this small patch that releases temporary charsets to avoid memory leak.
> 
> Test:
> 
> - [x] jdk_2d

> 

Hmmm, you are right. Phil probably pointed out the same problem, but I misunderstood it.

What's odd is that, I tested (made sure that `FcCharSetDestroy` indeed called), it did not crash and `valgrind` showed the leak site disappeared.

With your suggested fix, I think we still leak last `unionCharset`. BTW, the API documentation is really unhelpful, Sigh!

-------------

PR: https://git.openjdk.java.net/jdk/pull/8187



More information about the client-libs-dev mailing list