summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2012-07-24 20:18:35 (GMT)
committerdgp <dgp@users.sourceforge.net>2012-07-24 20:18:35 (GMT)
commit58515791c8e55bf546d15634a8caef7f41cf3d26 (patch)
tree7ba1bec4d7a58dc14e3c2478184ff4223e636207
parent821b59510a1cc1f459d8f7bbbed21d937e750493 (diff)
downloadtcl-58515791c8e55bf546d15634a8caef7f41cf3d26.zip
tcl-58515791c8e55bf546d15634a8caef7f41cf3d26.tar.gz
tcl-58515791c8e55bf546d15634a8caef7f41cf3d26.tar.bz2
Preserve the chanPtr so that script evaluation cannot invalidate it when
we plan to use it again.
-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);
}