Skip to content

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

Description

@ZhangHuan0407

public class BitmapFontCreateCommand
{

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

}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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