I'm simply running the following code in Borland C++ Builder Version 6;
for (int i = 0; i < 40000; i++)
{
try {
__int64 n = 0;
__int64 r = 1 / n;
}
catch (Exception& e) {}
}
and while running this loop, I see in task manager (Memory column) that it's leaking memory. Any idea why?
I was having memory leak while working on a calculating module in my project when I try to divide by zero and after hitting my head for many hours where is the memory leak, I realized that it's leaking memory in the above simple loop as well. No problem was found in the project.