Skip to content

Commit

Permalink
[netty#3368] Ensure ByteBuf is not release two times
Browse files Browse the repository at this point in the history
Motivation:

As the ByteBuf is not set to null after release it we may try to release it again in handleReadException()

Modifications:

-  set ByteBuf to null to avoid another byteBuf.release() to be called in handleReadException()

Result:

No IllegalReferenceCountException anymore
  • Loading branch information
sammychen105 authored and normanmaurer committed Jan 29, 2015
1 parent c5bd8fd commit 4bafb4f
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ public void read() {
if (localReadAmount <= 0) {
// not was read release the buffer
byteBuf.release();
byteBuf = null;
close = localReadAmount < 0;
break;
}
Expand Down

0 comments on commit 4bafb4f

Please sign in to comment.