fixed texture state leak