Join network thread before unload

This commit is contained in:
Sardelka9515
2023-02-03 13:30:37 +08:00
parent 6792559b5b
commit b4f86719ce
2 changed files with 3 additions and 3 deletions

View File

@ -101,10 +101,9 @@ namespace RageCoop.Client
WorldThread.DoQueuedActions();
if (IsUnloading)
{
ThreadManager.OnUnload();
Logger.Dispose();
Networking.Peer?.Shutdown("bye");
Thread.Sleep(1000);
Networking.Peer?.Dispose();
ThreadManager.OnUnload();
}
}
catch (Exception ex)

View File

@ -34,6 +34,7 @@ namespace RageCoop.Core
_stopping = true;
Shutdown("Bye!");
ListenerThread.Join();
Join();
}
public void SendTo(Packet p, NetConnection connection, ConnectionChannel channel = ConnectionChannel.Default,