Skip to content

Commit

Permalink
Update the UnsafeByteBufferOutput buffer address when it changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanSweet committed Jul 3, 2018
1 parent b94df85 commit a979be9
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,10 @@ private void updateBufferAddress () {
protected boolean require (int required) throws KryoException {
ByteBuffer oldBuffer = byteBuffer;
boolean result = super.require(required);
if (byteBuffer != oldBuffer) UnsafeUtil.dispose(oldBuffer);
if (byteBuffer != oldBuffer) {
UnsafeUtil.dispose(oldBuffer);
updateBufferAddress();
}
return result;
}

Expand Down

0 comments on commit a979be9

Please sign in to comment.