Similar to a previous PR I submitted there is another instance of removing the iterator during a for loop, causing a SIGSEGV error in Linux with the recent Multiplayer Peer.
Line 293 we iterate over steam_connections
for (KeyValue<HSteamNetConnection, Ref<SteamPacketPeer>> &E :
steam_connections) {
Then we execute disconnect_peer which modifies the steam_connections
My fix is the same as the previous PR. Build an array in the for loop, after iterating disconnect all the peers in the loop.
I'll be compiling in my builds and testing before releasing my update, looking for a merge / review on this PR.
Thanks,
Mark
Similar to [a previous PR I submitted](https://codeberg.org/godotsteam/multiplayerpeer/pulls/19) there is another instance of removing the iterator during a for loop, causing a **SIGSEGV** error in Linux with the recent Multiplayer Peer.
[Line 293](https://codeberg.org/godotsteam/multiplayerpeer/src/commit/388f1a9d8c06946f477b585b29026cad5d584c44/godotsteam_multiplayer_peer.cpp#L293) we iterate over `steam_connections`
```
for (KeyValue<HSteamNetConnection, Ref<SteamPacketPeer>> &E :
steam_connections) {
```
Then we execute [disconnect_peer](https://codeberg.org/godotsteam/multiplayerpeer/src/commit/388f1a9d8c06946f477b585b29026cad5d584c44/godotsteam_multiplayer_peer.cpp#L300) which [modifies the steam_connections ](https://codeberg.org/godotsteam/multiplayerpeer/src/branch/main/godotsteam_multiplayer_peer.cpp#L72)
[My fix](https://codeberg.org/bearlikelion/multiplayerpeer/commit/6daab97ca1195e19b2d72b10cef2bae7f96662a1) is the same as the previous PR. Build an array in the for loop, after iterating disconnect all the peers in the loop.
I'll be compiling in my builds and testing before releasing my update, looking for a merge / review on this PR.
Thanks,
Mark