Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions lldb/tools/lldb-dap/DAPSessionManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,9 @@ ManagedEventThread::~ManagedEventThread() {
}

DAPSessionManager &DAPSessionManager::GetInstance() {
static std::once_flag initialized;
static DAPSessionManager *instance =
nullptr; // NOTE: intentional leak to avoid issues with C++ destructor
// chain

std::call_once(initialized, []() { instance = new DAPSessionManager(); });

// NOTE: Intentional leak. Detached client threads may still notify
// m_sessions_condition at exit, so it has to outlive them.
static auto *instance = new DAPSessionManager();
return *instance;
}

Expand Down
Loading