[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-2d-dev
Subject:    Re: [OpenJDK 2D-Dev] RFR: 8261533: Java_sun_font_CFont_getCascadeList leaks memory according to Xcod
From:       Phil Race <prr () openjdk ! java ! net>
Date:       2021-02-12 16:18:38
Message-ID: ODUJR5MX05BuLjInVFpIPDyAF4ufSdgA0z_iWM084xQ=.59c745df-86e4-4700-a09c-c09cf0c60051 () github ! com
[Download RAW message or body]

On Fri, 12 Feb 2021 04:48:27 GMT, Prasanta Sadhukhan <psadhukhan@openjdk.org> wrote:

>> The various CF*Copy* functions called here need a matching CFRelease
>
> src/java.desktop/macosx/native/libawt_lwawt/font/AWTFont.m line 578:
> 
>> 576:         (*env)->CallBooleanMethod(env, arrayListOfString, addMID, jFontName);
>> 577:         if ((*env)->ExceptionOccurred(env)) {
>> 578:             CFRelease(fds);
> 
> but DeleteLocalRef(jFontName) shouldn't be called here too?

Unnecessary. The VM releases it when we return right here (next line)
The other delete is needed because we are in a loop and we don't know how many we might need
and it could exceed what the VM provisions for.

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

PR: https://git.openjdk.java.net/jdk/pull/2532
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic