mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2024-12-23 08:57:39 +01:00
Fix memory leak
This commit is contained in:
parent
75d7ffb447
commit
0613886659
@ -56,7 +56,7 @@ public class BungeeDecodeHandler extends MessageToMessageDecoder<ByteBuf> {
|
||||
|
||||
bytebuf.clear();
|
||||
bytebuf = newPacket;
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
// Clear Buffer
|
||||
bytebuf.clear();
|
||||
// Release Packet, be free!
|
||||
|
@ -60,7 +60,7 @@ public class BungeeEncodeHandler extends MessageToMessageEncoder<ByteBuf> {
|
||||
ProtocolInfo protInfo = info.get(ProtocolInfo.class);
|
||||
protInfo.getPipeline().transform(Direction.OUTGOING, protInfo.getState(), wrapper);
|
||||
wrapper.writeToBuffer(bytebuf);
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
bytebuf.clear();
|
||||
throw e;
|
||||
} finally {
|
||||
|
@ -57,7 +57,7 @@ public class SpongeDecodeHandler extends ByteToMessageDecoder {
|
||||
|
||||
bytebuf.clear();
|
||||
bytebuf = newPacket;
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
// Clear Buffer
|
||||
bytebuf.clear();
|
||||
// Release Packet, be free!
|
||||
|
@ -53,7 +53,7 @@ public class SpongeEncodeHandler extends MessageToByteEncoder {
|
||||
ProtocolInfo protInfo = info.get(ProtocolInfo.class);
|
||||
protInfo.getPipeline().transform(Direction.OUTGOING, protInfo.getState(), wrapper);
|
||||
wrapper.writeToBuffer(bytebuf);
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
bytebuf.clear();
|
||||
throw e;
|
||||
} finally {
|
||||
|
@ -53,7 +53,7 @@ public class VelocityDecodeHandler extends MessageToMessageDecoder<ByteBuf> {
|
||||
|
||||
bytebuf.clear();
|
||||
bytebuf = newPacket;
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
// Clear Buffer
|
||||
bytebuf.clear();
|
||||
// Release Packet, be free!
|
||||
|
@ -65,7 +65,7 @@ public class VelocityEncodeHandler extends MessageToMessageEncoder<ByteBuf> {
|
||||
bytebuf.clear();
|
||||
bytebuf.release();
|
||||
bytebuf = newPacket;
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
bytebuf.clear();
|
||||
bytebuf.release();
|
||||
newPacket.release();
|
||||
|
Loading…
Reference in New Issue
Block a user