Skip to content

Commit 92e1ebe

Browse files
author
Walter Erquinigo
committed
[trace] Fix destructor declaration
The destructor must be defined in the implementation class so that it can be called, as Vedant Kumar pointed out in: ''' What were your thoughts, re: +class Trace : public PluginInterface { +public: + ~Trace() override = default; Does this need to be `virtual ~Trace() = ...`? Otherwise, when a std::shared_ptr<Trace> is destroyed, the destructor for the derived TraceIntelPT instance won't run. '''
1 parent d94253b commit 92e1ebe

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lldb/include/lldb/Target/Trace.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ namespace lldb_private {
3535
/// this information.
3636
class Trace : public PluginInterface {
3737
public:
38-
~Trace() override = default;
39-
4038
/// Dump the trace data that this plug-in has access to.
4139
///
4240
/// This function will dump all of the trace data for all threads in a user

lldb/source/Plugins/Trace/intel-pt/TraceIntelPT.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ class TraceIntelPT : public lldb_private::Trace {
2020
public:
2121
void Dump(lldb_private::Stream *s) const override;
2222

23+
~TraceIntelPT() override = default;
24+
2325
/// PluginInterface protocol
2426
/// \{
2527
lldb_private::ConstString GetPluginName() override;

0 commit comments

Comments
 (0)