On Wed, 30 Nov 2022 23:25:16 GMT, Andy Goryachev <ango...@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

Reply via email to