Can some one please help what the order of destruction is when I am using virtual functions. Does it start with the base class and then derived class?
Virtual functions make no difference to the order of destruction, virtual base classes, on the other hand, do.
Without virtual base classes, derived classes are always destroyed before their base classes; this is the reverse order in which they are constructed.
For the most derived class, virtual base classes are constructed first, before other base classes and before the most derived class itself. Destruction happens in the reverse order. This means that a virtual base may be destroyed after a class that derives virtually from it, if that class is not the most derived class being destroyed. This can never happen for direct base classes.