Yesterday, working on my thesis, I felt like I died and resurrected more than once in a few hours. Trust me, I’m beginning to understand the way the compiler feels
Jokes apart, the following C++ code contains a bug similar to the one I found: can you spot it? (please forgive the bad indent )
void calledMethod( some_class *object )
{
arg = doSomething();
delete object;
object = new some_class( arg );
}
void callerMethod()
{
[...]
calledMethod( anObject );
anObject.doSomethingElse();
[...]
}
Related posts:
Tags: C++, debug, LinkedIn, memory leak, programmazione, tesi
