Open Gavitro opened 2 months ago
I'll need a little time to think this over. It was something I had observed once or twice, but felt it was benign enough to neglect. My rationale was that a handful of potential extra entries in a hashmap wasn't going to be enough of a problem in normal running cases to warrant a rework.
I think it could be relatively quick to fix it by listening for a peer disconnected signal and cleaning up the maps on that. The RPC signals are more intended for in-game comms rather than the entire client exiting.
When a peer disconnects, it attempts to RPC to other peers to unregister its own synchronizers, but often fails. As a result, the synchronizer maps of the remaining peers don't erase the disconnected peer's synchronizers, leading to memory leaks if left unchecked.
Steps to replicate