Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

如果主动关闭 视图调试窗口,应该释放对视图树的引用 #375

Open
kinarobin opened this issue Mar 23, 2022 · 0 comments
Open
Assignees
Labels
bug Something isn't working Platform: tenon

Comments

@kinarobin
Copy link
Contributor

kinarobin commented Mar 23, 2022

AnimationEntry1 子视图的释放在控制台不能输出

描述

Hummer version:

复现步骤

预期结果

class AnimationEntry1 extends View {
    view: View;
    constructor() {
        super();
        this.style = {
            width: 200,
            height: 200,
            backgroundColor: '#aa0044'
        };
        this.view = new View();
        this.view.style = {
            width: 100,
            height: 100,
            backgroundColor: '#00FF00'
        }
        this.appendChild(this.view);
    }
}

class RootView extends View {
    listViews:Array<AnimationEntry1> = new Array<AnimationEntry1>()

    constructor() {
        super();
        this.style = {
            width: '100%',
            height: '100%',
            backgroundColor: "#FF0000",
        }
        for (let index = 0; index <3; index++) {
            const element = new AnimationEntry1();
            this.listViews.push(element);
            this.appendChild(element);
        }
        this.addEventListener('tap', ()=> {
           while(this.listViews.length > 0) {
            this.listViews.pop();
           }
           this.removeAll();
           console.log("AnimationEntry 点击了");
        });
    }
}
Hummer.render(new RootView());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Platform: tenon
Projects
None yet
Development

No branches or pull requests

3 participants