Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure StreamWriter is disposed in time #510

Merged
merged 1 commit into from
Feb 26, 2024

Conversation

SadPencil
Copy link
Member

@SadPencil SadPencil commented Feb 21, 2024

Commit 6426387 changes the use of StreamWriter by using using var writer = new StreamWriter();, delaying the disposing work that triggers Flush() to the time when the whole function is ended, i.e., when game is already launched. This increase a chance where the spawner fails to read the configuration file written by the client (although rare).

This PR uses using (var writer = new StreamWriter()) to replace using var writer = new StreamWriter();

@SadPencil SadPencil force-pushed the fix-streamwriter-flush branch from 39ebbaa to 0103f4b Compare February 25, 2024 17:37
Copy link

Nightly build for this pull request:

@Metadorius Metadorius merged commit e1ad582 into CnCNet:develop Feb 26, 2024
3 checks passed
@SadPencil SadPencil deleted the fix-streamwriter-flush branch February 26, 2024 08:56
SadPencil added a commit to SadPencil/xna-cncnet-client that referenced this pull request Oct 4, 2024
SadPencil added a commit to SadPencil/xna-cncnet-client that referenced this pull request Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants