summaryrefslogtreecommitdiffstats
path: root/generic/tclIO.c
diff options
context:
space:
mode:
authordgp@users.sourceforge.net <dgp>2012-07-24 20:18:35 (GMT)
committerdgp@users.sourceforge.net <dgp>2012-07-24 20:18:35 (GMT)
commite72ea754d37215e66d1ff1bcfca56e517192cd20 (patch)
tree7ba1bec4d7a58dc14e3c2478184ff4223e636207 /generic/tclIO.c
parent7706631bdf9c1856d9ed272d4abdbed1415d8280 (diff)
downloadtcl-e72ea754d37215e66d1ff1bcfca56e517192cd20.zip
tcl-e72ea754d37215e66d1ff1bcfca56e517192cd20.tar.gz
tcl-e72ea754d37215e66d1ff1bcfca56e517192cd20.tar.bz2
Preserve the chanPtr so that script evaluation cannot invalidate it when
we plan to use it again.
Diffstat (limited to 'generic/tclIO.c')
-rw-r--r--generic/tclIO.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/generic/tclIO.c b/generic/tclIO.c
index a1d5447..b9cd30c 100644
--- a/generic/tclIO.c
+++ b/generic/tclIO.c
@@ -7540,6 +7540,7 @@ TclChannelEventScriptInvoker(clientData, mask)
*/
Tcl_Preserve((ClientData) interp);
+ Tcl_Preserve((ClientData) chanPtr);
result = Tcl_EvalObjEx(interp, esPtr->scriptPtr, TCL_EVAL_GLOBAL);
/*
@@ -7556,6 +7557,7 @@ TclChannelEventScriptInvoker(clientData, mask)
}
Tcl_BackgroundError(interp);
}
+ Tcl_Release((ClientData) chanPtr);
Tcl_Release((ClientData) interp);
}