inheritance dtor

I have a inheritence as follows

I also have a list of type c

All classes have copy.ctors

In the main program after a few inserts and.a call to print everything is fine
However a.breakpoint within.the dtor reveals that none of the data members of the objects within the list
have been not been copied
Any ideas
Last edited on
Hi there,

It's a bit hard to comment on this without seeing your code (for instance, destructor could mean either the destructor of a, b, or c in this case), but I'm going to take a wild guess and ask if you made the destructors of the parent classes virtual?

I'm also slightly confused why you are checking in the destructor if any data was copied. The destructor, as its name implies, is where members get destroyed.

Please feel free to rephrase the problem and / or provide some extra information if the above didn't help.

All the best,
Topic archived. No new replies allowed.