Fix texture release bug