Author Topic: Does the meterials of UITexture destroyed by itself when gameObject destroyed?  (Read 3385 times)

pengyingh

  • Guest
I remembered the meterials need to be destroyed separately,or will cause memory leak,but I haven‘t tested it.

quangpham

  • Guest
I got the same problem. Memory leak because materials don't be destroyed when destroyed game object. Is there anyone come up with any ideas to solve it?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
UITexture has this:
  1. void OnDestroy () { NGUITools.Destroy(mDynamicMat); }