Fix memory leak

This commit is contained in:
creeper123123321 2019-02-23 10:12:25 -03:00
parent 75d7ffb447
commit 0613886659
No known key found for this signature in database
GPG Key ID: 0AC57D54786721D1
6 changed files with 6 additions and 6 deletions

View File

@ -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!

View File

@ -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 {

View File

@ -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!

View File

@ -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 {

View File

@ -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!

View File

@ -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();