Original Post
I''ve got a problem with pointers and memory etc.
Ok here''s the situation.
I create a mesh temporarily.
Mesh details get stored i.e.:
tempMesh.face[1].vert = new CVertexID[3];
the function ends.
the temporary mesh is drawn.
>> the old mesh must be DELETED <<
a new temporary mesh is created
the function ends
etc.
What I need to do, is (i presume) store the location of the array of (in this example''s case) CVertexID, and delete[] the contents of that on the next pass around. So I''m thinking something along the lines of
CVertexID *p_oldVert;
p_oldVert = &tempMesh.face[1].vert;
then on next time the function is called:
delete[] p_oldVert;
OR SOMETHING ALONG THOSE LINES! ** confused **
Since the function MUST end before it is drawn, I think the correct references go out of context and so I can''t access them correctly.
Please if you have any insight, I have been stuck with this problem for about a week or two now. This is a core function so the memory leak over time is unacceptable!