On Fri, 22 Jan 2021 21:32:28 GMT, Kevin Rushforth <k...@openjdk.org> wrote:

>> John Hendrikx has updated the pull request with a new target base due to a 
>> merge or a rebase. The pull request now contains one commit:
>> 
>>   WIP: Moved treeShowingProperty into its own class
>
> modules/javafx.controls/src/main/java/javafx/scene/control/skin/ProgressIndicatorSkin.java
>  line 239:
> 
>> 237:         super.dispose();
>> 238: 
>> 239:         treeShowingExpression.dispose();
> 
> This could be removed if you are able to use `registerChangeListener` to add 
> the listener.

I'm not so sure, the listener will be removed from the `TreeShowingExpression` 
that was created, but the `TreeShowingExpression` itself is also registering 
listeners on the `ProgressIndicator`.  I don't see any `dispose` calls being 
done by the helper code.  If I'm correct, switching skins multiple times on a 
`ProgressIndicator` would create multiple `TreeShowingExpression`s which would 
create listeners on the `ProgressIndicator` which in turn reference the 
expression -- this would prevent the discarded skins from being GC'd.

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

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

Reply via email to