fixed memory leak in Texture2D::copyFrom and Texture2D::copyTo