[linux-audio-dev] A C++ question

Martijn Sipkema msipkema at sipkema-digital.com
Fri Apr 18 07:59:01 UTC 2003


[...]
> You always need a virtual destructor in the class if you do inhertance.
> Otherwise upon destruction of the derived class, the baseclass destructor
> will not be called.

I doubt that is the problem. You should use virtual destructors when
deleting using a pointer so the correct destructor is called but when
you know the pointer is of the correct type or you allocate the instance
on the stack then the correct destructor will be called and I think the
baseclass destructor(s) will be called also even if they are not
virtual.

--ms






More information about the Linux-audio-dev mailing list