RFR: 8319779: SystemMenu: memory leak due to listener never being removed [v6]

Johan Vos jvos at openjdk.org
Tue Jan 9 13:25:33 UTC 2024


On Tue, 9 Jan 2024 13:19:53 GMT, Johan Vos <jvos at openjdk.org> wrote:

>> A listener was added but never removed.
>> This patch removes the listener when the menu it links to is cleared. Fix for https://bugs.openjdk.org/browse/JDK-8319779
>
> Johan Vos has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - Cleanup test
>  - Add shim class so that we can access the references to com.sun.glass.ui.Menu instances.
>    Add a test to make sure those references are gone.

I added a systemtest using a new Shim (`GlassSystemMenuShim`) that keeps track of the `com.sun.glass.ui.Menu` instances that are created in the `GlassSystemMenu`. I had to do a few more hacks since you don't normally access `GlassSystemMenu` yourself (the MenuBarSkin is doing most of the work).
Note that this is very platform-dependent, as the creation of the `com.sun.glass.ui.Menu` is done by the `com.sun.glass.ui.Application`

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

PR Comment: https://git.openjdk.org/jfx/pull/1283#issuecomment-1883047997


More information about the openjfx-dev mailing list