Skip to content

Commit 65d15fe

Browse files
committed
[TargetList] Delete the destructor
AFAICT, ~TargetList simply implements the default destructor, plus some locking. The history is murky, so I'm not sure why we do this locking. Perhaps, at some point, it was possible to delete the same TargetList instance from two different threads, setting up a race. If that were true, then the locking would protect against the race. Since TargetList is uniquely owned by Debugger (m_target_list), no such race is possible today. Testing: check-lldb Differential Revision: https://reviews.llvm.org/D90895
1 parent 4fcdfc4 commit 65d15fe

File tree

2 files changed

+0
-8
lines changed

2 files changed

+0
-8
lines changed

lldb/include/lldb/Target/TargetList.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ class TargetList : public Broadcaster {
4242
return GetStaticBroadcasterClass();
4343
}
4444

45-
~TargetList() override;
46-
4745
/// Create a new Target.
4846
///
4947
/// Clients must use this function to create a Target. This allows

lldb/source/Target/TargetList.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,6 @@ TargetList::TargetList(Debugger &debugger)
4242
CheckInWithManager();
4343
}
4444

45-
// Destructor
46-
TargetList::~TargetList() {
47-
std::lock_guard<std::recursive_mutex> guard(m_target_list_mutex);
48-
m_target_list.clear();
49-
}
50-
5145
Status TargetList::CreateTarget(Debugger &debugger,
5246
llvm::StringRef user_exe_path,
5347
llvm::StringRef triple_str,

0 commit comments

Comments
 (0)