Free texture memory when an object is destroyed