Skip to content

Commit

Permalink
fix: close open files after compression
Browse files Browse the repository at this point in the history
  • Loading branch information
ZinoKader committed Feb 24, 2023
1 parent 5c5b207 commit 6fadc89
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ui/sender/sender.go
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,11 @@ func readFilesCmd(paths []string) tea.Cmd {
// provided files.
func compressFilesCmd(files []*os.File) tea.Cmd {
return func() tea.Msg {
defer func() {
for _, f := range files {
f.Close()
}
}()
tar, size, err := file.PackFiles(files)
if err != nil {
return ui.ErrorMsg(err)
Expand Down

0 comments on commit 6fadc89

Please sign in to comment.