Skip to content

Commit

Permalink
Shutdown network connection thread on exit
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeoliphant committed Jun 13, 2024
1 parent 7470534 commit c0e16b1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion StompboxRemote/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@
GameHost.IsMouseVisible = true;
GameHost.StartGame(game);

StompboxClient.Instance.NeedUIReload = true;
client.Disconnect();
}

8 changes: 8 additions & 0 deletions StompboxShared/StompboxClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,14 @@ public void Connect(string serverName, int port, Action<bool> connectCallback)
}
}

public void Disconnect()
{
if (InClientMode)
{
networkClient.Stop();
}
}

void ConnectCallback(bool result)
{
if (result)
Expand Down

0 comments on commit c0e16b1

Please sign in to comment.