Fix bug in Texture destructor