Original Post
I have a while loop that is in a display list that is something like this: I thought that when glDeleteTextures() is called it deletes all the memory glGenTextures() allocates. Why Am I getting memory leaks when I run this while loop? And the code in between isn't causing the problem because when I comment out the gl functions there is no leak. However, I need to generate a texture so I can't just leave them commented out.
while (i < l)
{
glGenTextures(1, &tex);
...
glDeleteTextures(1, &tex);
}