Fix composite buffer send bug

Fix a bug in CompositeBuffer.send, where the received buffer would not have ownership.
The fix is to avoid incrementing the reference count in the composite buffer constructor call used in the transferOwnership function.
This commit is contained in:
Chris Vest 2021-05-07 12:02:55 +02:00
parent 83643a5dc9
commit 9db454ffe5
2 changed files with 1 additions and 2 deletions

View File

@ -1351,7 +1351,7 @@ public final class CompositeBuffer extends RcSupport<Buffer, CompositeBuffer> im
for (int i = 0; i < sends.length; i++) {
received[i] = sends[i].receive();
}
var composite = new CompositeBuffer(allocator, received, drop, true);
var composite = new CompositeBuffer(allocator, received, drop, false);
composite.readOnly = readOnly;
drop.attach(composite);
return composite;

View File

@ -350,7 +350,6 @@ public class BufferReferenceCountingTest extends BufferTestSupport {
}
}
@Disabled // TODO
@ParameterizedTest
@MethodSource("allocators")
public void sliceMustBecomeOwnedOnSourceBufferClose(Fixture fixture) {