Skip to content

FIX resource leak #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 3, 2019
Merged

Conversation

yxdunc
Copy link
Contributor

@yxdunc yxdunc commented Dec 2, 2019

Description:

  • (6cf978b) FIX an issue that caused command with pipes to not terminate child processes
  • (b743c97) MAKE dosctring tests pass
  • (b03088c) REMOVE a log that was making the library unusable to use in the context of a CLI

Detail about resource leak (6cf978b):

As referred to on this page: https://doc.rust-lang.org/std/process/struct.Child.html
you need to wait() each child process to make sure the resources are properly freed.

This was actually causing the program to crash when calling a command containing a pipe
in a loop.

 - Add misssing use
 - Add needed :? for object not implementing fmt
 - Add a few no_run & compile_fail when needed
 - Ultimatly this log will remain but with a configurable logger
As refered to on this page: https://doc.rust-lang.org/std/process/struct.Child.html
you need to wait() each child process to make sure the ressources are properly freed.

This was actually causing the program to crash when calling a command containing a pipe
in a loop.
@tao-guo
Copy link
Collaborator

tao-guo commented Dec 3, 2019

Thanks for the patch. yes, I am also planning to implement the logger interface whenever I have more free time.

@rust-shell-script rust-shell-script merged commit 9f9cba4 into rust-shell-script:master Dec 3, 2019
@yxdunc
Copy link
Contributor Author

yxdunc commented Dec 12, 2019

Hello Tao, thanks for the merge!
Do you know when you'll be pushing a new version to crates.io?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants