forked from OSchip/llvm-project
Fix BroadcasterManager::RemoveListener to really remove the listener
This appears to be a real bug caught by -Wunused-value. std::find_if doesn't modify the underlying collection, it just returns an iterator pointing to the matching element. Reviewed By: JDevlieghere Differential Revision: https://reviews.llvm.org/D74010
This commit is contained in:
parent
7531a5039f
commit
50d2d33b8e
|
@ -406,7 +406,7 @@ void BroadcasterManager::RemoveListener(Listener *listener) {
|
|||
listener_collection::iterator iter = m_listeners.begin(),
|
||||
end_iter = m_listeners.end();
|
||||
|
||||
std::find_if(iter, end_iter, predicate);
|
||||
iter = std::find_if(iter, end_iter, predicate);
|
||||
if (iter != end_iter)
|
||||
m_listeners.erase(iter);
|
||||
|
||||
|
|
Loading…
Reference in New Issue