Skip to content

Commit

Permalink
Update MemoryStream.java
Browse files Browse the repository at this point in the history
  • Loading branch information
youfanx committed Jun 25, 2024
1 parent c93c61a commit b51981b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rxlib/src/main/java/org/rx/io/MemoryStream.java
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ public MemoryStream(@NonNull ByteBuf buf, boolean forWrite) {

@Override
protected void freeObjects() {
if (buffer != null) {
if (buffer != null && buffer.refCnt() > 0) {
buffer.release();
}
}
Expand Down

0 comments on commit b51981b

Please sign in to comment.