summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorandreas_kupries <akupries@shaw.ca>2005-11-18 17:14:51 (GMT)
committerandreas_kupries <akupries@shaw.ca>2005-11-18 17:14:51 (GMT)
commitb809fb72efb2a94910bd1a8519b3565ccfdc8911 (patch)
tree41cfa97f7439d0cf8be97a321fd3cbcd1478a0a2
parent9111fc11c29a3c9209dfc0baf0672eaff01e6ef3 (diff)
downloadtcl-b809fb72efb2a94910bd1a8519b3565ccfdc8911.zip
tcl-b809fb72efb2a94910bd1a8519b3565ccfdc8911.tar.gz
tcl-b809fb72efb2a94910bd1a8519b3565ccfdc8911.tar.bz2
* generic/tclIO.c (TclFinalizeIOSubsystem): Applied Pat Thoyts'
patch for [SF Tcl Bug 1359094]. This moves the retrieval of the next channel state to the end of the loop, as the called closeproc may close other channels, i.e. modify the list we are iterating, invalidating any pointer retrieved earlier.
-rw-r--r--ChangeLog8
-rw-r--r--generic/tclIO.c8
2 files changed, 14 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 14df576..5695874 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2005-11-18 Andreas Kupries <andreask@activestate.com>
+
+ * generic/tclIO.c (TclFinalizeIOSubsystem): Applied Pat Thoyts'
+ patch for [SF Tcl Bug 1359094]. This moves the retrieval of the
+ next channel state to the end of the loop, as the called
+ closeproc may close other channels, i.e. modify the list we are
+ iterating, invalidating any pointer retrieved earlier.
+
2005-11-18 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
* library/http/http.tcl (http::geturl): Improved syntactic validation
diff --git a/generic/tclIO.c b/generic/tclIO.c
index 4cf62ad..0c56c12 100644
--- a/generic/tclIO.c
+++ b/generic/tclIO.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclIO.c,v 1.61.2.15 2005/10/14 17:12:32 vasiljevic Exp $
+ * RCS: @(#) $Id: tclIO.c,v 1.61.2.16 2005/11/18 17:14:52 andreas_kupries Exp $
*/
#include "tclInt.h"
@@ -210,7 +210,6 @@ TclFinalizeIOSubsystem()
for (statePtr = tsdPtr->firstCSPtr; statePtr != (ChannelState *) NULL;
statePtr = nextCSPtr) {
chanPtr = statePtr->topChanPtr;
- nextCSPtr = statePtr->nextCSPtr;
/*
* Set the channel back into blocking mode to ensure that we wait
@@ -273,6 +272,11 @@ TclFinalizeIOSubsystem()
chanPtr->instanceData = (ClientData) NULL;
statePtr->flags |= CHANNEL_DEAD;
}
+ /*
+ * We look for the next pointer now in case we had one closed on up during
+ * the current channel's closeproc. (eg: rechan extension). [PT]
+ */
+ nextCSPtr = statePtr->nextCSPtr;
}
TclpFinalizePipes();
}