RFR: 8371128: NullPointerException occurs due to double cleanup of SwingNode [v2]
Kevin Rushforth
kcr at openjdk.org
Tue Nov 4 18:02:39 UTC 2025
On Tue, 4 Nov 2025 17:30:43 GMT, Andy Goryachev <angorya at openjdk.org> wrote:
>> 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.
Good catch. Other than being another possible source of an NPE, that one seems unrelated, so might be better handled as a follow-up. This one isn't a threading issue whereas the one you pointed out is.
@prsadhuk Can you at least take a look at it and see whether there is any relation to the bug you are fixing? If not, let's file a follow-up bug. The fix is to also check for null on the EDT before calling createUngrabEvent (as is done in disposeLwFrame -- even if you test lwFrame for null in the FX thread (to short-circuit creating the call on the EDT), you still need to check before use once you actually are on the EDT.
-------------
PR Review Comment: https://git.openjdk.org/jfx/pull/1960#discussion_r2491576342
More information about the openjfx-dev
mailing list