Etcetera. Neither "ADest" nor "BDest" is ever displayed. The behavior is that the loop whizzes by till c gets to be about 300, then things slow down, which seems like what you'd expect for a big memory leak, which appears to be what's happening since the destructor is not being called.

Also, when you need a temporary object only for the span of an iteration, you should just use a local variable, that is the favored mechanism in C++:

for(int i = 0; i < 1000000; i++)
{
B obj;
obj.foo();
}

Finally, DO NOT forget to make your base-class destructor virtual!!! This is very important to make sure that the most derived class destructor is called when you delete the object via a base-class pointer.