Revision: 77111
          http://sourceforge.net/p/brlcad/code/77111
Author:   starseeker
Date:     2020-09-12 16:47:48 +0000 (Sat, 12 Sep 2020)
Log Message:
-----------
Whoops - protect both calls, not just Tcl_Close

Modified Paths:
--------------
    brlcad/branches/RELEASE/src/libtclcad/commands.c

Modified: brlcad/branches/RELEASE/src/libtclcad/commands.c
===================================================================
--- brlcad/branches/RELEASE/src/libtclcad/commands.c    2020-09-12 16:36:25 UTC 
(rev 77110)
+++ brlcad/branches/RELEASE/src/libtclcad/commands.c    2020-09-12 16:47:48 UTC 
(rev 77111)
@@ -1240,20 +1240,23 @@
                return;
     struct tclcad_io_data *t_iod = (struct tclcad_io_data 
*)p->gedp->ged_io_data;
        switch (d) {
-       case BU_PROCESS_STDIN:
-               Tcl_DeleteChannelHandler(t_iod->chan_stdin, NULL, 
(ClientData)NULL);
-               if (t_iod->chan_stdin)
+           case BU_PROCESS_STDIN:
+               if (t_iod->chan_stdin) {
+                   Tcl_DeleteChannelHandler(t_iod->chan_stdin, NULL, 
(ClientData)NULL);
                    Tcl_Close(t_iod->interp, t_iod->chan_stdin);
+               }
                break;
-       case BU_PROCESS_STDOUT:
-               Tcl_DeleteChannelHandler(t_iod->chan_stdout, NULL, 
(ClientData)NULL);
-               if (t_iod->chan_stdout)
+           case BU_PROCESS_STDOUT:
+               if (t_iod->chan_stdout) {
+                   Tcl_DeleteChannelHandler(t_iod->chan_stdout, NULL, 
(ClientData)NULL);
                    Tcl_Close(t_iod->interp, t_iod->chan_stdout);
+               }
                break;
-       case BU_PROCESS_STDERR:
-               Tcl_DeleteChannelHandler(t_iod->chan_stderr, NULL, 
(ClientData)NULL);
-               if (t_iod->chan_stderr)
+           case BU_PROCESS_STDERR:
+               if (t_iod->chan_stderr) {
+                   Tcl_DeleteChannelHandler(t_iod->chan_stderr, NULL, 
(ClientData)NULL);
                    Tcl_Close(t_iod->interp, t_iod->chan_stderr);
+               }
                break;
        }
 }

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

Reply via email to