From a6ade7e78d30c63a4a870074fe3f5d3ffbb704f2 Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Sun, 26 May 2024 11:26:16 +1000 Subject: [PATCH] Close stream when done with it We should have been doing this from the start. Potential cause of a memory leak? --- pkg/gui/container_logs.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/gui/container_logs.go b/pkg/gui/container_logs.go index bb2feb85..95144478 100644 --- a/pkg/gui/container_logs.go +++ b/pkg/gui/container_logs.go @@ -114,8 +114,10 @@ func (gui *Gui) writeContainerLogs(container *commands.Container, ctx context.Co Follow: true, }) if err != nil { + gui.Log.Error(err) return err } + defer readCloser.Close() if container.DetailsLoaded() && container.Details.Config.Tty { _, err = io.Copy(writer, readCloser)