Hi there,
I have got a problem with a huge memory leak when I close down my program and I really can't track down how to stop it. I know it's probably me missing something obvious but please any advice or help will be greatfully recieved.
I have a simple ordered tree structure that is made up of nodes of the following type:
I create nodes very simply like this when I'm building the tree structure from my data:
When I have finished with them I have tried to free or delete the nodes but I can't seem to get them to clear away nicely. I either get memory access exceptions or the same old memory leak.
I know that if I had these nodes as classes I could change the constructor and destructor functions but what do I do since they are only structures?
Thanks in advance
M
I have got a problem with a huge memory leak when I close down my program and I really can't track down how to stop it. I know it's probably me missing something obvious but please any advice or help will be greatfully recieved.
I have a simple ordered tree structure that is made up of nodes of the following type:
Code:
typedef struct attrib_node
{
/* pointers to subtrees */
struct attrib_node *left, *right;
CString Name;
CString Value[MAX_STATES];
} Attrib_node;
I create nodes very simply like this when I'm building the tree structure from my data:
Code:
Attrib_node *new_nodep;
new_nodep = new Attrib_node;
When I have finished with them I have tried to free or delete the nodes but I can't seem to get them to clear away nicely. I either get memory access exceptions or the same old memory leak.
I know that if I had these nodes as classes I could change the constructor and destructor functions but what do I do since they are only structures?
Thanks in advance
M