Closed theawless closed 3 years ago
Now that I think about it, we probably don't need to play with iterators at all.
After cleaning up the swarms, we just need to clear()
the infoHashes set at the end.
Please let me know if that would be preferable, then I'll raise a new revision.
Now that I think about it, we probably don't need to play with iterators at all. After cleaning up the swarms, we just need to
clear()
the infoHashes set at the end.Please let me know if that would be preferable, then I'll raise a new revision.
Thanks @theawless. This PR is great!
If you want you can rewrite it with your suggestion. I think that approach will be cleaner.
We should not delete items from the container during a ranged for loop. This commit utilises the pointer returned by container erase.
Reference https://stackoverflow.com/questions/51744166 Fixes https://github.com/OpenWebTorrent/openwebtorrent-tracker/issues/19