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:
Reid Kleckner 2020-02-04 15:56:51 -08:00
parent 7531a5039f
commit 50d2d33b8e
1 changed files with 1 additions and 1 deletions

View File

@ -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);