How comes this code leaks memory?

Started by
9 comments, last by Juliean 10 years, 11 months ago

Thanks all for the additional explanation!

You realise that looking at the memory in the task manager is not a good indication to check if a memory leak is present. Install Valgrind or Visual Leak Detector to make sure you really have a memory leak or not. A never ending recursive function would show the same thing in task explorer until it hits the stack limit and then it will crash.

Yeah, sure, I wasn't even looking for a memory leak, I just happened to be looking at the task manager the right time and noticed that rise in memory. Turned out well this time, surely if I was really going after memory leaks I'd check out a tool for that case, thanks for the hints. Still, a endloss loop or recursive function is out of the question for this case, since, well, the the app was still running (no threads), and normally such a function would cause the app to die almost instantly (at least started with Debugger from Visual Studio), so I don't think its that bad as a general sign of some sort of memory related problem...

This topic is closed to new replies.

Advertisement