[LayaAirIDE 2.0]Image设置skin的Bug

加载资源较多的情况,直接设置Image设置skin方式加载资源,然后快速关闭界面,Image被
destroy(destroyChild: boolean = true): void {
        super.destroy(true);
        this._bitmap && this._bitmap.destroy();
        this._bitmap = null;
    }
 
2,当前资源加载完成后,回调设置皮肤资源找不到_bitmap
/**
     * @private
     * 设置皮肤资源。
     */
    protected setSource(url: string, img: any = null): void {
        if (url === this._skin && img) {
            this.source = img
            this.onCompResize();
        }
    } 
        /**
         * @inheritDoc 
         * @override
        */
        /*override*/ protected measureWidth(): number {
        return this._bitmap.width;
    }
image-bug.png
已邀请:

Aar0n

赞同来自:

这异步的加载 开发者要避免这种情况

要回复问题请先

商务合作
商务合作