Skip to content

Commit

Permalink
Fix PreparedPacket memory leak then refreshing limbos
Browse files Browse the repository at this point in the history
  • Loading branch information
UserNugget committed Jun 28, 2024
1 parent 5e2f384 commit 1489153
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,8 @@ public LimboImpl(LimboAPI plugin, VirtualWorld world) {
}

protected void refresh() {
this.localDispose();

this.built = true;
JoinGamePacket legacyJoinGame = this.createLegacyJoinGamePacket();
JoinGamePacket joinGame = this.createJoinGamePacket(ProtocolVersion.MINECRAFT_1_16);
Expand Down Expand Up @@ -729,6 +731,10 @@ public void dispose() {
}

private void localDispose() {
if (this.joinPackets == null) {
return;
}

this.joinPackets.release();
this.fastRejoinPackets.release();
this.safeRejoinPackets.release();
Expand Down

0 comments on commit 1489153

Please sign in to comment.