On Tue, 6 Jul 2021 20:21:09 GMT, Ambarish Rapte <ara...@openjdk.org> wrote:

>> I'm also interested in the opinion from others. I think we are a bit more 
>> safer with weak listener and there are used often as well. 
>> But as you correctly mentioned a lot of times (still) a listener is created 
>> inline. But I think on most occurences where it is not it is wrapped in an 
>> weak one.
>
> The main idea here is that we must remove the added listeners. 
> A Strong listener can cause leak and a WeakListener will not cause leak, but 
> if not removed then a WeakListener would be executed before it gets GCed.
> As long as we are removing them properly on disposal, they both look similar 
> to me, but yes we can be consistent in choosing appropriate listener.
> IMO, we can keep it out of scope of this PR, It can be taken as a follow up 
> issue and make a consistent change in bulk.

okay, leaving as-is - if we'll have too much time in future we can start a 
overall cleansing round :)

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

PR: https://git.openjdk.java.net/jfx/pull/534

Reply via email to