Skip to content

Commit

Permalink
Close stream when done with it
Browse files Browse the repository at this point in the history
We should have been doing this from the start. Potential cause of a
memory leak?
  • Loading branch information
jesseduffield committed May 26, 2024
1 parent 80af149 commit a6ade7e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/gui/container_logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit a6ade7e

Please sign in to comment.