fix segfault on glDeleteTextures