Deleting www.texture from memory

I am trying to remove www.texture from memory for webgl. Using the code below


Doesn’t remove it from memory. But calling


after we destory it seems to work (according to the profiler), but we get “m_instance != 0” constantly, which can be annoying. But testing it in a webgl build, it actually works without the error.

What do we do to properly remove a www.texture from memory?

Thanks for the help!

Try to write: www.texture = null; then Resources.UnloadUnusedAssets();

I suppose this will work because UnloadUnusedAssets unloads asset only when there are no references for this asset in the project

Hi, maybe it’s a bit late, the correct thing is:
Destroy (www.texture) and then www.texture = null

I also had memory problems and I have to apply those lines.