[#3368] Ensure ByteBuf is not release two times

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
This commit is contained in:
haohao 2015-01-29 16:26:13 +08:00 committed by Norman Maurer
parent d79e4ffe07
commit 97324454dd

View File

@ -120,6 +120,7 @@ public abstract class AbstractNioByteChannel extends AbstractNioChannel {
if (localReadAmount <= 0) { if (localReadAmount <= 0) {
// not was read release the buffer // not was read release the buffer
byteBuf.release(); byteBuf.release();
byteBuf = null;
close = localReadAmount < 0; close = localReadAmount < 0;
break; break;
} }