Inform the host of disconnect immediately so it can clean up properly

This commit is contained in:
Cameron Gutman
2018-06-09 21:37:42 -07:00
parent ed134f07d3
commit 77b277d05e

View File

@@ -582,7 +582,9 @@ int stopControlStream(void) {
PltCloseThread(&invalidateRefFramesThread);
if (peer != NULL) {
enet_peer_reset(peer);
// We use enet_peer_disconnect_now() so the host knows immediately
// of our termination and can cleanup properly for reconnection.
enet_peer_disconnect_now(peer, 0);
peer = NULL;
}
if (client != NULL) {