[lldb] Use SmallVector::erase correctly
erase() invalidates the iterator, we must use the returned iterator to continue iterating. This does not actually make a difference with the current implementation of SmallVector (erase will effectively return the same pointer), but it avoids future confusion.
This commit is contained in:
parent
1130e923e2
commit
b22ea2dc1e
@ -202,7 +202,7 @@ bool Broadcaster::BroadcasterImpl::RemoveListener(
|
||||
if (!curr_listener_sp) {
|
||||
// The weak pointer for this listener didn't resolve, lets' prune it
|
||||
// as we go.
|
||||
m_listeners.erase(it);
|
||||
it = m_listeners.erase(it);
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -213,8 +213,8 @@ bool Broadcaster::BroadcasterImpl::RemoveListener(
|
||||
if (!it->second)
|
||||
m_listeners.erase(it);
|
||||
return true;
|
||||
} else
|
||||
it++;
|
||||
}
|
||||
it++;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user