| # | Line 2 | Line 2 | |
|---|---|---|
| 2 | ||
| 3 | SubPipe::SubPipe(string command){ | |
| 4 | ||
| 5 | < | p = new iopipestream("statgrab.pl"); |
| 5 | > | p = new iopipestream(command.c_str()); |
| 6 | pid = (*p).pid(); | |
| 7 | ||
| 8 | } // subPipe | |
| # | Line 27 | Line 27 | SubPipe::~SubPipe(){ | |
| 27 | ||
| 28 | // wait for process to finish first | |
| 29 | waitpid(pid , 0, 0); | |
| 30 | + | // remove all pointers to it, free up the memory so |
| 31 | + | // we can reclaim the file handles back |
| 32 | delete p; | |
| 33 | ||
| 34 | } // ~SubPipe | |
| – | Removed lines |
| + | Added lines |
| < | Changed lines |
| > | Changed lines |