c++ Memory leak
Posted on 2012-09-18
I have a c++/CLI dll, this dll is used by a c# client to calculate data. When i run the call multiple times in succession i get a 'corrupted memory' exception (System.AccessViolationException). This exception occurs on the same iteration every time (Inputs can vary) so i believe it is caused by a memory leak.
I've used #define _CRTDBG_MAP_ALLOC to try to pinpoint potential issues, however the output from this simply shows that objects which are created during initialisation and designed to be held in memory for reuse are not cleared (as i would expect to happen)
My main c++ creates this storage in the constructor and should only release it when the c# client app is finished, so memory seems to be as i would expect.
Is my whole thought process wrong here?