From 13dbecc1e3b2a43850707d956f646a03405fed90 Mon Sep 17 00:00:00 2001 From: rsandell Date: Mon, 11 Sep 2023 17:09:04 +0200 Subject: [PATCH] [JENKINS-71970] Potentially solve memory leak --- .../jenkinsci/plugins/workflow/log/BufferedBuildListener.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/org/jenkinsci/plugins/workflow/log/BufferedBuildListener.java b/src/main/java/org/jenkinsci/plugins/workflow/log/BufferedBuildListener.java index 34a61c0f..e3ab264d 100644 --- a/src/main/java/org/jenkinsci/plugins/workflow/log/BufferedBuildListener.java +++ b/src/main/java/org/jenkinsci/plugins/workflow/log/BufferedBuildListener.java @@ -81,6 +81,7 @@ private Object readResolve() { @Override public void onClosed(Channel channel, IOException cause) { LOGGER.fine(() -> "closing " + channel.getName()); cos.close(channel, cause); + channel.removeListener(this); } }); return new BufferedBuildListener(cos);