non virtual TObject::~TObject()
Pasha Murat (murat@cdfsga.fnal.gov)
Thu, 9 Apr 1998 21:50:08 -0500 (CDT)
William J Deninger writes:
> Fred Gray has recently informed me of the procedure by which destructors are called and the difference between virtual and non virtual destructors implementation.
.... snip
>
> If this is correct, shouldn't root classes (such as TObject or any root class allowed to be inherited) have their destructors implemented as virtual?
Hi William,
what Fred Gray told you is correct. Let me guess that
destructors of the classes like TObject, TArray etc *ARE* implemented
as virtual for this very reason. For example TObject.h says:
.... snip
public:
virtual ~TObject();
Regards, Pasha.