how do you destroy a texture2d array ?

I have an update loop on the iphone that adds a texture to an array every .1 seconds. After the array fills up I want to destroy it and start over. I seem to be unable to destroy the texture2d array because memory on the iphone accumulates quickly and crashes the app. So how would I destroy these textures. I tried destroying them in a for loop
var textures=new Texture2D[10];
//textures are put in each .1 seconds until full.


but that doesn’t seem to work. Could someone explain the best way to destroy and delete the memory associated with a texture2d if it’s by itself or in an array?

Destroying Unity objects won’t have any effect on memory, since they aren’t part of Mono and aren’t subject to garbage collection. You can use Resources.UnloadUnusedAssets. Also Unity objects are cleaned up when loading a new level.

foreach (var texture in textures)
Texture2D.DestroyImmediate(texture, true);

Tested and seem to work fine!

For the most part you’re right, but try using Texture2D.Destroy instead of just Destroy