From 8a3b6403da678f291a34cfb47fabd36e6768aeee Mon Sep 17 00:00:00 2001 From: Andrew Steinborn Date: Sat, 7 Nov 2020 09:40:09 -0500 Subject: [PATCH] Wrap plugin message copies in unreleasable copies. Trying to track down a very weird issue that barely makes sense to me. --- .../proxy/connection/backend/BackendPlaySessionHandler.java | 2 +- .../proxy/connection/client/ClientPlaySessionHandler.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/proxy/src/main/java/com/velocitypowered/proxy/connection/backend/BackendPlaySessionHandler.java b/proxy/src/main/java/com/velocitypowered/proxy/connection/backend/BackendPlaySessionHandler.java index abd1f7b91..34103f52d 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/connection/backend/BackendPlaySessionHandler.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/connection/backend/BackendPlaySessionHandler.java @@ -146,7 +146,7 @@ public class BackendPlaySessionHandler implements MinecraftSessionHandler { .thenAcceptAsync(pme -> { if (pme.getResult().isAllowed() && !playerConnection.isClosed()) { PluginMessage copied = new PluginMessage(packet.getChannel(), - Unpooled.wrappedBuffer(copy)); + Unpooled.unreleasableBuffer(Unpooled.wrappedBuffer(copy))); playerConnection.write(copied); } }, playerConnection.eventLoop()) diff --git a/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ClientPlaySessionHandler.java b/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ClientPlaySessionHandler.java index cd443ebe3..ae6d3bb3d 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ClientPlaySessionHandler.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ClientPlaySessionHandler.java @@ -230,7 +230,7 @@ public class ClientPlaySessionHandler implements MinecraftSessionHandler { server.getEventManager().fire(event).thenAcceptAsync(pme -> { if (pme.getResult().isAllowed()) { PluginMessage message = new PluginMessage(packet.getChannel(), - Unpooled.wrappedBuffer(copy)); + Unpooled.unreleasableBuffer(Unpooled.wrappedBuffer(copy))); backendConn.write(message); } }, backendConn.eventLoop())