View Full Version : GLU_TESS_COMBINE

01-17-2002, 04:17 PM
I'm curious. What happens to the allocate memory in the Combine
Callback function?

Does the GLU tesselator delete it after gluDeleteTess() is called?

I need to know if this is a potential memory leak or not,
because I don't see anyway of deleting it myself.


void GLCALLBACK CombineCB( GLdouble coords[3],
void* vertex_data[4],
GLfloat weight[4],
void** outData ) {

GLdouble *vertex;

vertex = new double[3];

vertex[0] = coords[0];
vertex[1] = coords[1];
vertex[2] = coords[2];

*outData = vertex;

The docs on GLU_TESS_COMBINE specifically say:

"Free the memory sometime after calling gluTessEndPolygon."

But where does this memory go? Do I have to keep track of
it myself?

01-17-2002, 10:02 PM
Yes, store these vertices and delete them after finishing the tesselation.