Hello everyone I am trying to ensure that I have now memory leaks within my program that I am working on for school. I am having problems ensuring that my object data is being successfully removed through a deconstructor. I run the program with the code I am listing and end with no errors but on when I follow the program I see that I am not actually deleting the object rather empty the contents with the object framework still in place. Any help would be greatly appreciated.
Deconstructor Implementation in the cpp file
1 2 3 4 5
Account::~Account()
{
delete psn;
psn = nullptr;
}// end deconstructor
I am looking at the local data-members and inserting breakpoints within the program an up until the last line of program the return in main the framework of the person array is visible no data is in the array but the array is there and if I understand correctly that is a memory leak.
If not then I am simply not understanding the concept of the memory leak.
How do you know that? Are you sure that it is not the issue of debugger continuing to show content of actual memory regardles of the fact if it was deallocated?
Can you create a minimum working example reproducing your problem and post it along with your compiler name and screenshot confirming the problem?
I double checked what I was seeing and I did successfully remove the array out of the heap I just had a break that was prior to the removal after double checking here and with others I seem to have completed the assignment just need to work a little more on how to use the debugger more efficiently.