
9 Feb
2009
9 Feb
'09
9:01 p.m.
Emil Dotchevski wrote:
You're probably doing something wrong, shared_ptr doesn't require virtual destructor to call the correct destructor. Here is a working example: http://codepad.org/sktELTDk
Yes, it needs a virtual destructor if it's a shared_ptr to the base class, otherwise you can't achieve type erasure. This virtual call does not happen with boost::interprocess::shared_ptr because virtuality is forbidden in shared memory. Regards, Ion