fixed texture memory leak