Skip to content

[Bug] JFXListViewSkin 在频繁更新时会创建大量平台线程 #4720

@burningtnt

Description

@burningtnt

问题描述 | Bug Description

com.jfoenix.skins.JFXListViewSkin::new 代码如下:

public JFXListViewSkin(JFXListView<T> listView) {
    super(listView);
    JFXDepthManager.setDepth(this.getFlow(), (Integer)listView.depthProperty().get());
    listView.depthProperty().addListener((o, oldVal, newVal) -> JFXDepthManager.setDepth(this.getFlow(), newVal));
    listView.getItems().addListener((change) -> (new Thread(() -> {
            try {
                Thread.sleep(20L);
            } catch (InterruptedException intEx) {
                intEx.printStackTrace();
            }
            Platform.runLater(() -> ((ListView)this.getSkinnable()).requestLayout());
        })).start());
}

这会在 listView 每次更新时创建一个新的平台线程,耗尽用户电脑上的资源。

启动器崩溃报告 / 启动器日志文件 | Launcher Crash Report / Launcher Log File

/

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions