3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-11-20 15:00:09 +01:00

Fix memory leak

Dieser Commit ist enthalten in:
creeper123123321 2019-02-23 10:12:25 -03:00
Ursprung 75d7ffb447
Commit 0613886659
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 0AC57D54786721D1
6 geänderte Dateien mit 6 neuen und 6 gelöschten Zeilen

Datei anzeigen

@ -56,7 +56,7 @@ public class BungeeDecodeHandler extends MessageToMessageDecoder<ByteBuf> {
bytebuf.clear(); bytebuf.clear();
bytebuf = newPacket; bytebuf = newPacket;
} catch (Exception e) { } catch (Throwable e) {
// Clear Buffer // Clear Buffer
bytebuf.clear(); bytebuf.clear();
// Release Packet, be free! // Release Packet, be free!

Datei anzeigen

@ -60,7 +60,7 @@ public class BungeeEncodeHandler extends MessageToMessageEncoder<ByteBuf> {
ProtocolInfo protInfo = info.get(ProtocolInfo.class); ProtocolInfo protInfo = info.get(ProtocolInfo.class);
protInfo.getPipeline().transform(Direction.OUTGOING, protInfo.getState(), wrapper); protInfo.getPipeline().transform(Direction.OUTGOING, protInfo.getState(), wrapper);
wrapper.writeToBuffer(bytebuf); wrapper.writeToBuffer(bytebuf);
} catch (Exception e) { } catch (Throwable e) {
bytebuf.clear(); bytebuf.clear();
throw e; throw e;
} finally { } finally {

Datei anzeigen

@ -57,7 +57,7 @@ public class SpongeDecodeHandler extends ByteToMessageDecoder {
bytebuf.clear(); bytebuf.clear();
bytebuf = newPacket; bytebuf = newPacket;
} catch (Exception e) { } catch (Throwable e) {
// Clear Buffer // Clear Buffer
bytebuf.clear(); bytebuf.clear();
// Release Packet, be free! // Release Packet, be free!

Datei anzeigen

@ -53,7 +53,7 @@ public class SpongeEncodeHandler extends MessageToByteEncoder {
ProtocolInfo protInfo = info.get(ProtocolInfo.class); ProtocolInfo protInfo = info.get(ProtocolInfo.class);
protInfo.getPipeline().transform(Direction.OUTGOING, protInfo.getState(), wrapper); protInfo.getPipeline().transform(Direction.OUTGOING, protInfo.getState(), wrapper);
wrapper.writeToBuffer(bytebuf); wrapper.writeToBuffer(bytebuf);
} catch (Exception e) { } catch (Throwable e) {
bytebuf.clear(); bytebuf.clear();
throw e; throw e;
} finally { } finally {

Datei anzeigen

@ -53,7 +53,7 @@ public class VelocityDecodeHandler extends MessageToMessageDecoder<ByteBuf> {
bytebuf.clear(); bytebuf.clear();
bytebuf = newPacket; bytebuf = newPacket;
} catch (Exception e) { } catch (Throwable e) {
// Clear Buffer // Clear Buffer
bytebuf.clear(); bytebuf.clear();
// Release Packet, be free! // Release Packet, be free!

Datei anzeigen

@ -65,7 +65,7 @@ public class VelocityEncodeHandler extends MessageToMessageEncoder<ByteBuf> {
bytebuf.clear(); bytebuf.clear();
bytebuf.release(); bytebuf.release();
bytebuf = newPacket; bytebuf = newPacket;
} catch (Exception e) { } catch (Throwable e) {
bytebuf.clear(); bytebuf.clear();
bytebuf.release(); bytebuf.release();
newPacket.release(); newPacket.release();