Skip to content

Commit

Permalink
Use Run() instead of Start() to execute notification helpers
Browse files Browse the repository at this point in the history
Using Start() but not waiting for the command to complete will leave dangling
defunct processes that can't be cleaned up until its parent dies.

Run() will wait for the command to finish, but cleans up after itself.
  • Loading branch information
muesli committed Jun 2, 2019
1 parent aa3d7c1 commit eda1963
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions notify_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func Notify(title, message, appIcon string) error {
}

c := exec.Command(send, title, message, "-i", appIcon)
return c.Start()
return c.Run()
}

knotify := func() error {
Expand All @@ -34,7 +34,7 @@ func Notify(title, message, appIcon string) error {
return err
}
c := exec.Command(send, "--title", title, "--passivepopup", message, "10", "--icon", appIcon)
return c.Start()
return c.Run()
}

conn, err := dbus.SessionBus()
Expand Down

0 comments on commit eda1963

Please sign in to comment.