Skip to content

Commit

Permalink
Merge #3328 into 3.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
chemicL committed Nov 29, 2023
2 parents c6220fc + 5b22db2 commit ac8e520
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ public class OnDiscardShouldNotLeakTest {
.doOnSuccess(l -> l.forEach(Tracked::safeRelease))
.thenReturn(Tracked.RELEASED)),
DiscardScenario.fluxSource("collectList", f -> f.collectList()
.doOnSuccess(l -> l.forEach(Tracked::safeRelease))
.thenReturn(Tracked.RELEASED)),
DiscardScenario.fluxSource("streamCollector", f -> f.collect(Collectors.toList())
.doOnSuccess(l -> l.forEach(Tracked::safeRelease))
Expand Down
6 changes: 6 additions & 0 deletions reactor-core/src/test/java/reactor/test/MemoryUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,12 @@ public static void safeRelease(Object t) {
}
else if (t instanceof Tracked) {
((Tracked) t).release();
} else if (t instanceof Collection) {
for (Object o : (Collection) t) {
if (o instanceof Tracked) {
((Tracked) o).release();
}
}
}
}

Expand Down

0 comments on commit ac8e520

Please sign in to comment.