From 59dc83eadbde4521cb3076cccb4f5e2963a70d4b Mon Sep 17 00:00:00 2001 From: Richard Berger <richard.berger@temple.edu> Date: Tue, 9 Aug 2016 04:08:01 -0400 Subject: [PATCH] Fix resource leak --- python/lammps.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/python/lammps.py b/python/lammps.py index 0a996d0235..9f7e02e8e4 100644 --- a/python/lammps.py +++ b/python/lammps.py @@ -304,6 +304,9 @@ class OutputCapture(object): def __exit__(self, type, value, tracebac): os.dup2(self.stdout, self.stdout_fd) + os.close(self.stdout) + os.close(self.stdout_pipe_read) + os.close(self.stdout_pipe_write) # check if we have more to read from the pipe def more_data(self, pipe): -- GitLab