fix memory leak when reload texture