We have come out a project which can 100%(?) duplicate this issue (4/4) based on your RGB template in the tutorail for async loading. The App will crash in about 2 mins after you have started it.
Please find it under this link. And the credential is “nuitrack”.
With your script, RGB textures remain in memory after they’re shown. As a result, memory is filled. You can edit the script
DrawColorFrame and add the deletion of a texture after it’s used:
public class DrawColorFrame : MonoBehaviour
[SerializeField] RawImage background;
NuitrackManager.onColorUpdate += DrawColor;
Texture2D bgTexture; //new line
void DrawColor(nuitrack.ColorFrame frame)
Destroy(bgTexture); //new line
bgTexture = frame.ToTexture2D(); //new line
background.texture = bgTexture; //modified
In this code, the texture is saved to
bgTexture, shown and destroyed before it’s used again.