Re: [sigc] sigc::trackable::~trackable() is not virtual



On Thu, 2006-10-26 at 17:19 +0200, stephan beal wrote:
> It's not silly at all!!!! You're relying on UNDEFINED BEHAVIOUR when
> you 
> subclass a type which doesn't have a virtual dtor. 

That's not true. It's undefined (or quite clearly, a memory leak, I
think), if you use it polymorphically (because you are likely to delete
it via the base class. That's why compilers warn if you have virtual
methods without a virtual destructor.

In this case, nobody is very likely to use the sigc::trackable base
class directly.

There are perfectly valid reasons to have base classes without virtual
destructors. Performance is one possible reason.

-- 
Murray Cumming
murrayc murrayc com
www.murrayc.com
www.openismus.com




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]