dispose the previous ordermanager (so the file will get closed, among other things)

This commit is contained in:
Chris Forbes
2010-05-05 18:15:48 +12:00
parent d2009e9e7d
commit 9302440613
2 changed files with 19 additions and 1 deletions

View File

@@ -170,8 +170,11 @@ namespace OpenRA
internal static void JoinServer(string host, int port)
{
if (orderManager != null) orderManager.Dispose();
CurrentHost = host;
CurrentPort = port;
orderManager = new OrderManager(new NetworkConnection( host, port ), ChooseReplayFilename());
}
@@ -182,6 +185,7 @@ namespace OpenRA
internal static void JoinLocal()
{
if (orderManager != null) orderManager.Dispose();
orderManager = new OrderManager(new EchoConnection());
}