Possible leak on setOnAction

Thiago Milczarek Sayão thiago.sayao at gmail.com
Thu Apr 18 10:41:34 UTC 2024


Hi,

I'm pretty sure setOnAction is holding references.

I have a "Open Windows" menu on my application where it lists the Stages
opened and if you click, it calls stage.toFront():

menuItem.seOnAction(e -> stage.toFront())

I had many crash reports, all OOM. I got the hprof files and analyzed them
- turns out this was holding references to all closed stages.

To fix it, I call setOnAction(null) when the stage is closed.

I will investigate further and provide an example.

-- Thiago.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/openjfx-dev/attachments/20240418/85874f80/attachment.htm>


More information about the openjfx-dev mailing list