On Fri, 12 Jun 2026 11:17:29 GMT, Marius Hanl <[email protected]> wrote:

>> Michael Strauß has updated the pull request incrementally with one 
>> additional commit since the last revision:
>> 
>>   review comments
>
> modules/javafx.controls/src/main/java/javafx/scene/control/skin/PaginationSkin.java
>  line 419:
> 
>> 417: 
>> 418:         if (deferredStartup != null) {
>> 419:             deferredStartup.cancel();
> 
> We should also `null` the `deferredStartup` here

This is the same case as in `TabRowSkinBase.dispose()`, it's generally not 
necessary to null out fields of objects we are disposing.

> modules/javafx.controls/src/main/java/javafx/scene/control/skin/TableRowSkinBase.java
>  line 147:
> 
>> 145:     public void dispose() {
>> 146:         if (currentTransitions != null) {
>> 147:             currentTransitions.forEach((_, value) -> value.stop());
> 
> We should `clear()` the `currentTransitions` here

This shouldn't be necessary, since the object is being disposed here. After 
that, it is no longer usable and will be eligible for GC. Nulling out fields 
really only makes sense when the object is _not_ disposed, when only the 
interior object should be GC'd, but not the enclosing object.

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

PR Review Comment: https://git.openjdk.org/jfx/pull/2177#discussion_r3406277237
PR Review Comment: https://git.openjdk.org/jfx/pull/2177#discussion_r3406287422

Reply via email to