Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix dead loop in message filter #532

Merged
merged 2 commits into from Apr 19, 2022
Merged

Fix dead loop in message filter #532

merged 2 commits into from Apr 19, 2022

Conversation

kingsimba
Copy link
Contributor

The bug is introduced in #461

std::remove_if() will only put elements to the back of the vector. One must call erase to actually remove them.

The bug is introduced in #461

`std::remove_if()` will only put elements to the back of the vector. One must call erase to actually remove them.
@kingsimba kingsimba requested a review from tfoote as a code owner April 18, 2022 09:50
another `remove_if`
Copy link
Member

@tfoote tfoote left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, thanks for catching that. It definitely can lead to unfortunate memory growth.

There's a much better function erase_if which is what I had thought it was doing. But that's not available until c++20 so we can't use it yet.

@tfoote tfoote merged commit 08a7cee into ros:noetic-devel Apr 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants