n3to93838 / iphone-glu

Automatically exported from code.google.com/p/iphone-glu
0 stars 0 forks source link

Tesselator leaks memory #2

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I have some iPhone test code doing tesselation (ported some example).

static void combineCallback(GLdouble coords[3], GLdouble *vertex_data[4],
                     GLfloat weight[4], GLdouble **dataOut)

This method will create some array - vertex = (GLdouble *) malloc(6 * 
sizeof(GLdouble)); -, which 
will be sent to static void vertexCallback(GLvoid *vertex). When I build with 
Run->Start With 
Performance Tool->Leaks, it will show several leaks.

One leak, GeneralBlock-48, happens with allocation at this method, which I 
pasted here. Some 
other leaks are also happening.

Use extended detail view of leaks to easily detect, where those leaks are 
happening.

Original issue reported on code.google.com by qtv...@gmail.com on 16 Nov 2009 at 3:21

GoogleCodeExporter commented 8 years ago
I add each new (combined) vertex to a mutable array.  After the tessellated 
primitives are returned I free all the malloc'ed memory for each element of the 
mutable array.  I do not observe ANY leaks.

Original comment by tonys...@gmail.com on 11 May 2012 at 1:47