From c5d7b197524d838c0ce8b962297a63cb585ee3cb Mon Sep 17 00:00:00 2001 From: Horst Schirmeier Date: Wed, 9 Sep 2020 20:13:25 +0200 Subject: [PATCH] perf: call onDeletion in the right places Change-Id: I920aacec475d8ec3f51e11bcb59f37b84a730ee7 --- src/core/sal/ListenerManager.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/sal/ListenerManager.cc b/src/core/sal/ListenerManager.cc index 8e804c78..3a7df8c5 100644 --- a/src/core/sal/ListenerManager.cc +++ b/src/core/sal/ListenerManager.cc @@ -156,7 +156,7 @@ void ListenerManager::remove(ExperimentFlow* flow) // ... need to be pushed into m_DeleteList, as we're currently // iterating over m_FireList in triggerActiveListeners() and cannot modify it if (flow == 0 || (*it)->getParent() == flow) { - (*it)->onDeletion(); + // Note: onDeletion was previously called within makeActive() m_DeleteList.push_back(*it); } } @@ -209,6 +209,9 @@ void ListenerManager::makeActive(BaseListener* pLi) if (pLi->getCounter() > 0) return; pLi->resetCounter(); + + pLi->onDeletion(); + // Remove the index of the listener from the performance buffer-list: pLi->getPerformanceBuffer()->remove(pLi->getLocation()); // Move the listener object from the buffer-list to the fire-list: