I am using GLUT and auxDIBImageLoadA and I am thinking on some problems about memory management :
-
I use exit(0) to exit form glutMainLoop. But does it really delete the Rendering Context ? Should I better use CloseWindow ?
-
I initialize my texture by :
AUX_RGBImageRec *texture = (AUX_RGBImageRec *) NULL;
… …
texture = auxDIBImageLoadA (“filename.bmp”);
Before calling exit (0), I delete my textures with :
LocalFree(texture);
Is this enough ? Should I better free texture -> data ? And if the texture was stored in the accelerator card 's memory,
will it really be deleted ?
Please help !