RFR: 8299423: JavaFX Mac system menubar leaks [v2]
Florian Kirmaier
fkirmaier at openjdk.org
Mon Jan 2 09:26:14 UTC 2023
> This PR fixes the leak in the mac system menu bar.
>
> Inside the native code, NewGlobalRef is called for the callable.
> Which makes it into a "GC-Root" until DeleteGlobalRef is called.
>
> The DeleteGlobalRef is never called for the MenuEntry, if it's removed from the menu without removing it's callable.
> This PR adds logic, whether the Menu is inserted. If it's not inserted in a Menu anymore, then DeleteGlobalRef is called, by calling `_setCallback` with the callable "null".
>
> The unit test verifies, that this bug happened without this change, but no longer happens with this change.
Florian Kirmaier has updated the pull request incrementally with one additional commit since the last revision:
JDK-8299423
Simplified the fix for the mac-menu-bar based on code review
-------------
Changes:
- all: https://git.openjdk.org/jfx/pull/987/files
- new: https://git.openjdk.org/jfx/pull/987/files/661ed5e4..02d37146
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jfx&pr=987&range=01
- incr: https://webrevs.openjdk.org/?repo=jfx&pr=987&range=00-01
Stats: 49 lines in 2 files changed: 0 ins; 44 del; 5 mod
Patch: https://git.openjdk.org/jfx/pull/987.diff
Fetch: git fetch https://git.openjdk.org/jfx pull/987/head:pull/987
PR: https://git.openjdk.org/jfx/pull/987
More information about the openjfx-dev
mailing list