Skip to content

Commit db645ed

Browse files
committed
leak wrapper fix
1 parent 5797b76 commit db645ed

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

test/framework/src/main/java/org/elasticsearch/test/ESTestCase.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1001,12 +1001,10 @@ public static BytesReference randomBytesReference(int length) {
10011001
}
10021002

10031003
public ReleasableBytesReference randomReleasableBytesReference(int length) {
1004-
return new ReleasableBytesReference(randomBytesReference(length), new AbstractRefCounted() {
1004+
return new ReleasableBytesReference(randomBytesReference(length), LeakTracker.wrap(new AbstractRefCounted() {
10051005
@Override
1006-
protected void closeInternal() {
1007-
LeakTracker.wrap(AbstractRefCounted.of(() -> {}));
1008-
}
1009-
});
1006+
protected void closeInternal() {}
1007+
}));
10101008
}
10111009

10121010
public static short randomShort() {

0 commit comments

Comments
 (0)