Skip to content

Commit

Permalink
Fix some memory leak warnings
Browse files Browse the repository at this point in the history
Fixes #1215
  • Loading branch information
ChrisLane committed Jun 3, 2020
1 parent 27ca7bc commit a1aae95
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ public void decodeInto(ChannelHandlerContext ctx, ByteBuf data)
legSwing = data.readFloat();
leftStack = ByteBufUtils.readItemStack(data);
rightStack = ByteBufUtils.readItemStack(data);

data.release();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ public void decodeInto(ChannelHandlerContext ctx, ByteBuf data)
gear = data.readBoolean();
doors = data.readBoolean();
wings = data.readBoolean();

data.release();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ public void decodeInto(ChannelHandlerContext ctx, ByteBuf data)
seatId = data.readInt();
yaw = data.readFloat();
pitch = data.readFloat();

data.release();
}

@Override
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/flansmod/common/network/PacketTeamInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,10 @@ public void decodeInto(ChannelHandlerContext ctx, ByteBuf data)
FlansMod.log.throwing(e);
teamData = new TeamData[]{new TeamData()};
}
finally
{
data.release();
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ public void decodeInto(ChannelHandlerContext ctx, ByteBuf data)
{
super.decodeInto(ctx, data);
doors = data.readBoolean();

data.release();
}

@Override
Expand Down

0 comments on commit a1aae95

Please sign in to comment.