summaryrefslogtreecommitdiffstats
path: root/generic/tclIORChan.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2014-04-24 15:27:58 (GMT)
committerdgp <dgp@users.sourceforge.net>2014-04-24 15:27:58 (GMT)
commit790e5adaf4cabf6c9dcaa3d109427dbe18f786ff (patch)
tree9a00b0d5759743211bd698082450c791ccf436b1 /generic/tclIORChan.c
parent5b5f0209a4f6007ff2804da3f32258bb2148e814 (diff)
downloadtcl-790e5adaf4cabf6c9dcaa3d109427dbe18f786ff.zip
tcl-790e5adaf4cabf6c9dcaa3d109427dbe18f786ff.tar.gz
tcl-790e5adaf4cabf6c9dcaa3d109427dbe18f786ff.tar.bz2
Make sure the ReflectedChannel struct is freed in the handler thread,
where it was allocated. This constraint allows the struct to safely hold Tcl_Obj values, which has been convenient for storing callback commands.
Diffstat (limited to 'generic/tclIORChan.c')
-rw-r--r--generic/tclIORChan.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/generic/tclIORChan.c b/generic/tclIORChan.c
index e462f61..94428bb 100644
--- a/generic/tclIORChan.c
+++ b/generic/tclIORChan.c
@@ -1145,6 +1145,7 @@ ReflectClose(
if (result != TCL_OK) {
FreeReceivedError(&p);
}
+ return EOK;
}
#endif
@@ -1169,8 +1170,6 @@ ReflectClose(
Tcl_DeleteEvents(ReflectEventDelete, rcPtr);
- Tcl_EventuallyFree(rcPtr, (Tcl_FreeProc *) FreeReflectedChannel);
-
if (result != TCL_OK) {
PassReceivedErrorInterp(interp, &p);
}
@@ -2903,6 +2902,7 @@ ForwardProc(
Tcl_GetChannelName(rcPtr->chan));
Tcl_DeleteHashEntry(hPtr);
+ Tcl_EventuallyFree(rcPtr, (Tcl_FreeProc *) FreeReflectedChannel);
break;
case ForwardedInput: {