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

[../common/JackProfiler.cpp:121]: (error) Iterator 'it' used after element has been erased. #71

Open
dcb314 opened this issue Sep 30, 2014 · 4 comments

Comments

@dcb314
Copy link

dcb314 commented Sep 30, 2014

            profiler->fClientTable.erase(it);
            delete((*it).second);

Suggest swap order of statements.

@sletz
Copy link
Member

sletz commented Sep 30, 2014

Why?

@dcb314
Copy link
Author

dcb314 commented Sep 30, 2014

After you've erased something by using an iterator, the iterator is
invalid, so doing indirection on it doesn't make much sense.

Suggest use return value from erase, as per standard C++ literature.

@sletz
Copy link
Member

sletz commented Sep 30, 2014

Patch welcome.

@karllinden
Copy link
Contributor

Which steps are required to reproduce this? This is also quite old. Maybe it should be closed...

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

3 participants