summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authordgp@users.sourceforge.net <dgp>2012-10-02 16:08:42 (GMT)
committerdgp@users.sourceforge.net <dgp>2012-10-02 16:08:42 (GMT)
commitc51150e73de83d6d395582ba38f5859a6a85783f (patch)
tree58ef9c906fe94de732115171d7074352863f1917 /generic
parenta68ba8596952190e68693c48ab3c899265cd7b71 (diff)
downloadtcl-c51150e73de83d6d395582ba38f5859a6a85783f.zip
tcl-c51150e73de83d6d395582ba38f5859a6a85783f.tar.gz
tcl-c51150e73de83d6d395582ba38f5859a6a85783f.tar.bz2
Fix for core bug yet to be named/numbered.
Diffstat (limited to 'generic')
-rw-r--r--generic/tclIO.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/generic/tclIO.c b/generic/tclIO.c
index 4e24533..0cb9fa9 100644
--- a/generic/tclIO.c
+++ b/generic/tclIO.c
@@ -879,19 +879,25 @@ CheckForStdChannelsBeingClosed(
ChannelState *statePtr = ((Channel *) chan)->state;
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
- if ((chan == tsdPtr->stdinChannel) && tsdPtr->stdinInitialized) {
+ if (tsdPtr->stdinInitialized
+ && tsdPtr->stdinChannel != NULL
+ && statePtr == ((Channel *)tsdPtr->stdinChannel)->state) {
if (statePtr->refCount < 2) {
statePtr->refCount = 0;
tsdPtr->stdinChannel = NULL;
return;
}
- } else if ((chan == tsdPtr->stdoutChannel) && tsdPtr->stdoutInitialized) {
+ } else if (tsdPtr->stdoutInitialized
+ && tsdPtr->stdoutChannel != NULL
+ && statePtr == ((Channel *)tsdPtr->stdoutChannel)->state) {
if (statePtr->refCount < 2) {
statePtr->refCount = 0;
tsdPtr->stdoutChannel = NULL;
return;
}
- } else if ((chan == tsdPtr->stderrChannel) && tsdPtr->stderrInitialized) {
+ } else if (tsdPtr->stderrInitialized
+ && tsdPtr->stderrChannel != NULL
+ && statePtr == ((Channel *)tsdPtr->stderrChannel)->state) {
if (statePtr->refCount < 2) {
statePtr->refCount = 0;
tsdPtr->stderrChannel = NULL;