Skip to content

texture2d使用结束后需要释放 #1

@ZhangHuan0407

Description

@ZhangHuan0407

public class BitmapFontCreateCommand
{

void BuildTextureAtlas()
{
    var textureAtlas = new Texture2D(1, 1, TextureFormat.ARGB32, false);
    //use textureAtlas 
    UnityEngine.Object.DestroyImmediate(textureAtlas); // 您的代码中缺少纹理释放,这可能导致内存泄漏
}

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions