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

Possible segfault culprit #77

Open
ksatyaki opened this issue Apr 21, 2022 · 3 comments
Open

Possible segfault culprit #77

ksatyaki opened this issue Apr 21, 2022 · 3 comments

Comments

@ksatyaki
Copy link

delete currentGroup;

Perhaps needs a continue after deletion? Because currentGroup is accessed immediately afterwards. It's bound to fail, right? Or am I missing something?

@tlind
Copy link
Member

tlind commented Apr 21, 2022

Where do you think it is accessed immediately afterwards?
The expression in line 261 and the statement in line 263 are inside an "else" block. Thus they cannot be executed at the same time in which the delete statement (inside the if that belongs to this else) is invoked, as they are in alternative code paths.

@tlind
Copy link
Member

tlind commented Apr 21, 2022

Ah, I just realized that the outer for-each loop extends further. In line 267, 270 etc. this might indeed cause trouble, I think you're right...

@ksatyaki
Copy link
Author

ksatyaki commented Apr 21, 2022

Also, most foreach can be safely converted to for loops, I think.
As far as I am aware, there are only specific cases where the Qt foreach is mandatory.
Possibly unrelated, I saw that someone else had ported most of pedsim_ros to ROS2. I am completing just that. :-)

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

No branches or pull requests

2 participants