Revision: 76847
http://sourceforge.net/p/brlcad/code/76847
Author: starseeker
Date: 2020-08-19 13:39:24 +0000 (Wed, 19 Aug 2020)
Log Message:
-----------
Valgrind pegged which fd was getting leaked. If we close this, also shouldn't
process Tcl events in cmdline mode after the commands finish.
Modified Paths:
--------------
brlcad/trunk/src/libbu/process.c
brlcad/trunk/src/mged/mged.c
Modified: brlcad/trunk/src/libbu/process.c
===================================================================
--- brlcad/trunk/src/libbu/process.c 2020-08-19 08:21:31 UTC (rev 76846)
+++ brlcad/trunk/src/libbu/process.c 2020-08-19 13:39:24 UTC (rev 76847)
@@ -487,6 +487,7 @@
if (!pinfo)
return -1;
+ close(pinfo->fd_in);
close(pinfo->fd_out);
close(pinfo->fd_err);
Modified: brlcad/trunk/src/mged/mged.c
===================================================================
--- brlcad/trunk/src/mged/mged.c 2020-08-19 08:21:31 UTC (rev 76846)
+++ brlcad/trunk/src/mged/mged.c 2020-08-19 13:39:24 UTC (rev 76847)
@@ -1568,16 +1568,13 @@
// If we launched subcommands, we need to process their
// output before quitting. Do one up front to catch
// anything produced by a process that already exited,
- // loop while libged still reports running processes,
- // and then a final call before quitting to get the
- // last output from the last command.
- Tcl_DoOneEvent(TCL_ALL_EVENTS|TCL_DONT_WAIT);
+ // and loop while libged still reports running processes.
+ Tcl_DoOneEvent(TCL_ALL_EVENTS|TCL_DONT_WAIT);
while (BU_PTBL_LEN(&GEDP->ged_subp)) {
- Tcl_DoOneEvent(TCL_ALL_EVENTS|TCL_DONT_WAIT);
+ Tcl_DoOneEvent(TCL_ALL_EVENTS|TCL_DONT_WAIT);
// Limit CPU burn in case of long running subcommands
- Tcl_Sleep(1);
+ Tcl_Sleep(1);
}
- Tcl_DoOneEvent(TCL_ALL_EVENTS|TCL_DONT_WAIT);
const char *av[2];
av[0] = "q";
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits