Skip to content

#794 shared_ptr does not call derived class constructor

Metadata

Property Value
Reported by Carsten Gräser (graeser@math.fu-berlin.de)
Reported at May 31, 2010 10:32
Type Bug Report
Version Git (pre2.4) [autotools]
Operating System Unspecified / All
Last edited by Oliver Sander (oliver.sander@tu-dresden.de)
Last edited at Oct 27, 2010 10:30
Closed by Oliver Sander (oliver.sander@tu-dresden.de)
Closed at Oct 27, 2010 10:30
Closed in version Unknown
Resolution Won't fix
Comment This is mentioned as a known issue in the release notes now.

Description

With Dune::shared_ptr only the destructor of the base class A will be called in the following example:

struct A{...}; struct B:public A{...}; { shared_ptr p = shared_ptr(new B); }

In contrast the shared_ptr in (std|std::tr1|boost) will call the destructor of B even if it is not virtual.