Usages of TextureFromFile in the game to load an image from StreamingAssets could lead to a memory leak of the loaded texture in the case of the TextureFromFile instance being cancelled before it finished.
This would happen in the case of the saga map collection view object reuse (e.g. SagaMapPlayStoryPolaroid
) where a view object would be loaded and an initial TextureFromFile
instance would get created, and then in the same frame that view object would be recycled and reused for a different section of the map, causing that original TextureFromFile
instance to be cancelled.
The TextureFromFile.Cancel
method looked like this:
public void Cancel()