RFR: 8294589: MenuBarSkin: memory leak when changing skin [v15]
John Hendrikx
jhendrikx at openjdk.org
Thu Dec 1 17:52:38 UTC 2022
On Wed, 30 Nov 2022 23:25:16 GMT, Andy Goryachev <angorya at openjdk.org> wrote:
> but instead the whole component or Pane might be removed from the scene and discarded.
If that happens, weak reference won't make a difference there either. Removing an entire branch from the Scene and not referring to it anymore will do correct clean-up even without a call to dispose and without the use of weak references.
The only use case I see is that we still don't trust the Skin lifecycle to be adhered to and "just in case" are using weak references in case somehow dispose is not called. I would much prefer to see an actual reason to use it, and then adding a comment as to why this weak reference is needed so that in 6 months time we're not scratching our heads as to why a weak reference is needed here.
-------------
PR: https://git.openjdk.org/jfx/pull/906
More information about the openjfx-dev
mailing list