修复 TaskListPane.StatusChangeListener 持有 ListCell 的强引用的问题 (#4347)
This commit is contained in:
@@ -279,7 +279,7 @@ public final class TaskListPane extends StackPane {
|
|||||||
private final JFXProgressBar bar = new JFXProgressBar();
|
private final JFXProgressBar bar = new JFXProgressBar();
|
||||||
|
|
||||||
private WeakReference<StageNode> prevStageNodeRef;
|
private WeakReference<StageNode> prevStageNodeRef;
|
||||||
private ChangeListener<StageNode.Status> statusChangeListener;
|
private StatusChangeListener statusChangeListener;
|
||||||
|
|
||||||
private Cell() {
|
private Cell() {
|
||||||
setPadding(new Insets(0, 0, 4, 0));
|
setPadding(new Insets(0, 0, 4, 0));
|
||||||
@@ -364,8 +364,9 @@ public final class TaskListPane extends StackPane {
|
|||||||
pane.setBottom(null);
|
pane.setBottom(null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private final class StatusChangeListener implements ChangeListener<StageNode.Status>, WeakListener {
|
private static final class StatusChangeListener implements ChangeListener<StageNode.Status>, WeakListener {
|
||||||
|
|
||||||
private final WeakReference<Cell> cellRef;
|
private final WeakReference<Cell> cellRef;
|
||||||
|
|
||||||
@@ -391,7 +392,6 @@ public final class TaskListPane extends StackPane {
|
|||||||
cell.updateLeftIcon(newValue);
|
cell.updateLeftIcon(newValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
private static abstract class Node {
|
private static abstract class Node {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user