mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
clean up better when exec fails
This commit is contained in:
parent
9f9ec8d80b
commit
66c9cb9f8c
@ -343,6 +343,8 @@ open_pipe(const string &cmd) {
|
|||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
cerr << "Unable to redirect stdout\n";
|
cerr << "Unable to redirect stdout\n";
|
||||||
#endif
|
#endif
|
||||||
|
CloseHandle(hChildStdoutRd);
|
||||||
|
CloseHandle(hChildStdoutWr);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -357,6 +359,8 @@ open_pipe(const string &cmd) {
|
|||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
cerr << "DuplicateHandle failed\n";
|
cerr << "DuplicateHandle failed\n";
|
||||||
#endif
|
#endif
|
||||||
|
CloseHandle(hChildStdoutRd);
|
||||||
|
CloseHandle(hChildStdoutWr);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
CloseHandle(hChildStdoutRd);
|
CloseHandle(hChildStdoutRd);
|
||||||
@ -377,7 +381,7 @@ open_pipe(const string &cmd) {
|
|||||||
cerr << "Unable to spawn process.\n";
|
cerr << "Unable to spawn process.\n";
|
||||||
#endif
|
#endif
|
||||||
close_pipe();
|
close_pipe();
|
||||||
return false;
|
// Don't return yet, since we still need to clean up.
|
||||||
}
|
}
|
||||||
|
|
||||||
delete[] cmdline;
|
delete[] cmdline;
|
||||||
@ -387,8 +391,6 @@ open_pipe(const string &cmd) {
|
|||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
cerr << "Unable to restore stdout\n";
|
cerr << "Unable to restore stdout\n";
|
||||||
#endif
|
#endif
|
||||||
close_pipe();
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Close the write end of the pipe before reading from the
|
// Close the write end of the pipe before reading from the
|
||||||
@ -397,11 +399,9 @@ open_pipe(const string &cmd) {
|
|||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
cerr << "Unable to close write end of pipe\n";
|
cerr << "Unable to close write end of pipe\n";
|
||||||
#endif
|
#endif
|
||||||
close_pipe();
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return (_child_out != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
|
Loading…
x
Reference in New Issue
Block a user