RFR: 8262518: SwingNode.setContent does not close previous content, resulting in memory leak [v2]

Prasanta Sadhukhan psadhukhan at openjdk.org
Wed Aug 23 10:47:30 UTC 2023


On Wed, 23 Aug 2023 10:13:32 GMT, John Hendrikx <jhendrikx at openjdk.org> wrote:

>> Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Optimize without WeakReference
>
> modules/javafx.swing/src/main/java/com/sun/javafx/embed/swing/Disposer.java line 94:
> 
>> 92:     public static void removeRecord(DisposerRecord rec) {
>> 93:         disposerInstance.records.remove(rec);
>> 94:     }
> 
> Sorry, but this won't work.  The record is not the key, see this line:
> 
>              disposerInstance.records.put(ref, rec);

I am not sure if this `removeRecord `is necessary for swing-interop Disposer...Other javafx Disposer like
modules/javafx.base/src/main/java/com/sun/javafx/property/adapter/Disposer.java
also does not have `removeRecord` method

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

PR Review Comment: https://git.openjdk.org/jfx/pull/1219#discussion_r1302833923


More information about the openjfx-dev mailing list