Close packet output stream before saving replay

Aside from being best practice, this is necessary for the recording CRC to be
written to the replay file (cause that only happens on close).

Also potentially fixes https://github.com/ReplayMod/ReplayMod/issues/144 though
that should already be covered by ZipReplayFile tracking and closing all of its
`OutputStream`s before saving.
This commit is contained in:
Jonas Herzig
2020-05-08 11:30:06 +02:00
parent 8193006aea
commit 4e5122db5d

View File

@@ -233,6 +233,11 @@ public class PacketListener extends ChannelInboundHandlerAdapter {
} catch (InterruptedException e) {
logger.error("Waiting for save service termination:", e);
}
try {
packetOutputStream.close();
} catch (IOException e) {
logger.error("Failed to close packet output stream:", e);
}
synchronized (replayFile) {
try {