On 30/09/2020 20:25, Walter Erquinigo wrote: > But what about the case Vedant mentioned? > >> Otherwise, when a std::shared_ptr<Trace> is destroyed, the destructor for >> the derived TraceIntelPT instance won't run. > > Or is C++ smart enough to pick the destructor from TraceIntelPT class in this > case?
Well, yes. Once a base class has a virtual distructor, the destructors of all derived classes will be virtual (no matter how they are declared). The virtualness guarantees that the destructor of the actual (runtime) class type gets invoked. pl _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits