hanumanth

Hi all,

A memory leak is showing by purifyer in my code

it is showing the same line for 4 memory leaks in the line

hRes = pThisNode->get_parentNode(&pParentNode);

plz tell me how to fix these memory leaks.

Thanks




Re: Visual C++ Language Memory leak

Sam1981

Hi,

Maybe you should call the release method for the pParentNode and pThisNode if you don't want to use them anymore, so that the resources of these two pointers can be deleted.





Re: Visual C++ Language Memory leak

Prasad Somwanshi

hRes = pThisNode->get_parentNode(&pParentNode);

Generally, such method allocates memory for pointer prameter provided.

You need free memory allocated there. As said, either use Release, if its interface pointer, and delete if its class pointer.