Close stream when done with it

We should have been doing this from the start. Potential cause of a
memory leak?
This commit is contained in:
Jesse Duffield 2024-05-26 11:26:16 +10:00
parent 80af149b02
commit a6ade7e78d

View file

@ -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)