[Lldb-commits] [lldb] Allow multiple destroy callbacks in `SBDebugger::SetDestroyCallback()` (PR #89868)

via lldb-commits lldb-commits at lists.llvm.org
Fri Apr 26 13:47:04 PDT 2024


================
@@ -743,10 +743,11 @@ DebuggerSP Debugger::CreateInstance(lldb::LogOutputCallback log_callback,
 }
 
 void Debugger::HandleDestroyCallback() {
-  if (m_destroy_callback) {
-    m_destroy_callback(GetID(), m_destroy_callback_baton);
-    m_destroy_callback = nullptr;
+  const lldb::user_id_t user_id = GetID();
----------------
royitaqi wrote:

Added double while-loop in `HandleDestroyCallback` to handle callbacks which can be added/removed during destroy. Added test `test_HandleDestroyCallback` to validate a simple example case.

https://github.com/llvm/llvm-project/pull/89868


More information about the lldb-commits mailing list