(1.2.2) Fix rare memleak in EaglerXBungee's HttpWebServer

This commit is contained in:
lax1dude 2024-05-29 19:30:34 -07:00
parent 40a60f992e
commit d02938c5f8
5 changed files with 5 additions and 4 deletions

View File

@ -57,8 +57,8 @@ import net.md_5.bungee.BungeeCord;
*/ */
public class EaglerXBungee extends Plugin { public class EaglerXBungee extends Plugin {
public static final String NATIVE_BUNGEECORD_BUILD = "1.20-R0.3-SNAPSHOT:18eae8a:1842"; public static final String NATIVE_BUNGEECORD_BUILD = "1.20-R0.3-SNAPSHOT:52ab21b:1844";
public static final String NATIVE_WATERFALL_BUILD = "1.20-R0.3-SNAPSHOT:37a9ace:577"; public static final String NATIVE_WATERFALL_BUILD = "1.20-R0.3-SNAPSHOT:a65bb68:578";
static { static {
CompatWarning.displayCompatWarning(); CompatWarning.displayCompatWarning();

View File

@ -219,6 +219,7 @@ public class HttpWebServer {
if(lastMod != file.lastDiskModified) { if(lastMod != file.lastDiskModified) {
int fileSize = (int)f.length(); int fileSize = (int)f.length();
try(FileInputStream is = new FileInputStream(f)) { try(FileInputStream is = new FileInputStream(f)) {
file.fileData.release();
file.fileData = Unpooled.buffer(fileSize, fileSize); file.fileData = Unpooled.buffer(fileSize, fileSize);
file.fileData.writeBytes(is, fileSize); file.fileData.writeBytes(is, fileSize);
file.lastDiskReload = millis; file.lastDiskReload = millis;

View File

@ -1,5 +1,5 @@
name: EaglercraftXBungee name: EaglercraftXBungee
main: net.lax1dude.eaglercraft.v1_8.plugin.gateway_bungeecord.EaglerXBungee main: net.lax1dude.eaglercraft.v1_8.plugin.gateway_bungeecord.EaglerXBungee
version: 1.2.1 version: 1.2.2
description: Plugin to allow EaglercraftX 1.8 players to join your network, or allow EaglercraftX 1.8 players to use your network as a proxy to join other networks description: Plugin to allow EaglercraftX 1.8 players to join your network, or allow EaglercraftX 1.8 players to use your network as a proxy to join other networks
author: lax1dude author: lax1dude

View File

@ -1 +1 @@
1.2.1 1.2.2