aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Utility/Event.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Utility/Event.cpp')
-rw-r--r--lldb/source/Utility/Event.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/lldb/source/Utility/Event.cpp b/lldb/source/Utility/Event.cpp
index fcc367f43f93..cac118182c75 100644
--- a/lldb/source/Utility/Event.cpp
+++ b/lldb/source/Utility/Event.cpp
@@ -11,6 +11,7 @@
#include "lldb/Utility/Broadcaster.h"
#include "lldb/Utility/DataExtractor.h"
#include "lldb/Utility/Endian.h"
+#include "lldb/Utility/Listener.h"
#include "lldb/Utility/Stream.h"
#include "lldb/Utility/StreamString.h"
#include "lldb/lldb-enumerations.h"
@@ -80,8 +81,16 @@ void Event::Dump(Stream *s) const {
}
void Event::DoOnRemoval() {
+ std::lock_guard<std::mutex> guard(m_listeners_mutex);
+
if (m_data_sp)
m_data_sp->DoOnRemoval(this);
+ // Now that the event has been handled by the primary event Listener, forward
+ // it to the other Listeners.
+ EventSP me_sp = shared_from_this();
+ for (auto listener_sp : m_pending_listeners)
+ listener_sp->AddEvent(me_sp);
+ m_pending_listeners.clear();
}
#pragma mark -