Search Unity

Texture still in memory even after release.

Discussion in 'Addressables' started by EDevJogos, Jan 19, 2019.

  1. EDevJogos

    EDevJogos

    Joined:
    Jul 24, 2014
    Posts:
    75
    So, what i did was: set a Sprite as addressable and than load it into a
    UnityEngine.UI.Image.sprite
    when the display is shown with:

    Code (CSharp):
    1.  UnityEngine.AddressableAssets.Addressables.LoadAsset<Sprite>("Credits").Completed += (operation) =>
    2.             {
    3.                 creditsImage.sprite = operation.Result;
    4.             };
    When it's no longer needed i set the
    Image.sprite
    to
    null
    and release the addressable Sprite loaded:

    Code (CSharp):
    1. UnityEngine.AddressableAssets.Addressables.ReleaseAsset(creditsImage.sprite);
    2.  
    3. creditsImage.sprite = null;
    But when i check the profiller the Sprite is still there consuming memory and it's referenced to the ResourcesManager.

    resourcemanager.PNG
     
    Last edited: Jan 19, 2019
  2. unity_bill

    unity_bill

    Joined:
    Apr 11, 2017
    Posts:
    1,053
    EDevJogos likes this.