Memory Leak
-
I ran code analysis on my project. It told me I had a memory leak. I have a Linked List class with an Add function. The Add function receives parameters, then it creates a node and fills it with those parameters. I can't understand why their is a leak!
-
I ran code analysis on my project. It told me I had a memory leak. I have a Linked List class with an Add function. The Add function receives parameters, then it creates a node and fills it with those parameters. I can't understand why their is a leak!
ok, but how do you remove items from the list ? is it done automatically by the list class destructor ?
Watched code never compiles.
-
ok, but how do you remove items from the list ? is it done automatically by the list class destructor ?
Watched code never compiles.
list class destructor!
-
I ran code analysis on my project. It told me I had a memory leak. I have a Linked List class with an Add function. The Add function receives parameters, then it creates a node and fills it with those parameters. I can't understand why their is a leak!
This may sound like a daft couple of questions... - Are you sure the memory leak is in your class? Try swapping it for one that you know doesn't leak like std::list and run your analysis again. - Why on earth are you writing your own linked list? std::list will probably do as good a job in most cases. Ash
-
This may sound like a daft couple of questions... - Are you sure the memory leak is in your class? Try swapping it for one that you know doesn't leak like std::list and run your analysis again. - Why on earth are you writing your own linked list? std::list will probably do as good a job in most cases. Ash
Aescleal wrote:
- Why on earth are you writing your own linked list?
Academia.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius