RFR: 8371128: NullPointerException occurs due to double cleanup of SwingNode [v2]

Andy Goryachev angorya at openjdk.org
Tue Nov 4 17:33:59 UTC 2025


On Tue, 4 Nov 2025 17:28:44 GMT, Andy Goryachev <angorya at openjdk.org> wrote:

>> modules/javafx.swing/src/main/java/javafx/embed/swing/SwingNode.java line 283:
>> 
>>> 281:                     SwingNodeHelper.runOnEDT(() -> {
>>> 282:                         if (lwFrame != null) {
>>> 283:                             swNodeIOP.overrideNativeWindowHandle(lwFrame, 0L,
>> 
>> question: is it possible to have `lwFrame` set to `null` between L282 and L283?
>
> seems like being set in the EDT always

BUT, in line 555 we are accessing lwFrame from the FX app thread, in a completely unsafe manner - test followed by use.

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

PR Review Comment: https://git.openjdk.org/jfx/pull/1960#discussion_r2491457526


More information about the openjfx-dev mailing list