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

via lldb-commits lldb-commits at lists.llvm.org
Thu Apr 25 16:22:48 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();
----------------
jimingham wrote:

I meant the former.  You could have added two Destroy callbacks, but then during the execution of the first one, the code figures out that it has already done the job the second one was intended to do, so the first Destroy callback removed the second one on the way out to keep the work from getting done twice.

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


More information about the lldb-commits mailing list