My application needs to change the renderTexture of swf in runtime.
I try to add the myRTT component and destroy it in order to change the texture.
This way works but I found that the memory usage is continue to increase.
I found that the Destroy function inside SFRTT.cs is commented out and there is no coding
to remove the flash content in memory even I destroy the myRTT component.
Could you advise how can I solve the issues?
Solved! Go to Solution.
Solved by adam.petrone. Go to Solution.
It's not enough to uncomment the SFRTT.Destroy method. You also need to call RTTMovie.Destroy(). That should solve the memory leak.
This is what the final method should look like in SFRTT:
public virtual void OnDestroy() { renderer.material.mainTexture = null; RenderTexture = null; RTTMovie.Destroy(); RTTMovie = null; }
Regards,
-Adam