Fixed a memory leak in Texture::copyFrom