summaryrefslogtreecommitdiffstats
path: root/generic/tclIO.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2013-02-25 18:05:22 (GMT)
committerdgp <dgp@users.sourceforge.net>2013-02-25 18:05:22 (GMT)
commit3793c270002b4994dabec9d831ad8d6a42b716e7 (patch)
tree991bbc90430b7520bec5edd2e54ef8fcff76ed47 /generic/tclIO.c
parent6083020b04f6fb36eb0b9b125e5e60e113c3b5ea (diff)
downloadtcl-3793c270002b4994dabec9d831ad8d6a42b716e7.zip
tcl-3793c270002b4994dabec9d831ad8d6a42b716e7.tar.gz
tcl-3793c270002b4994dabec9d831ad8d6a42b716e7.tar.bz2
Repair linked list management in Tcl_DeleteCloseHandler().
CloseCallback struct is used only locally. Remove from tclIO.h.
Diffstat (limited to 'generic/tclIO.c')
-rw-r--r--generic/tclIO.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/generic/tclIO.c b/generic/tclIO.c
index eace472..ed08112 100644
--- a/generic/tclIO.c
+++ b/generic/tclIO.c
@@ -70,6 +70,18 @@ typedef struct ThreadSpecificData {
static Tcl_ThreadDataKey dataKey;
/*
+ * Structure to record a close callback. One such record exists for
+ * each close callback registered for a channel.
+ */
+
+typedef struct CloseCallback {
+ Tcl_CloseProc *proc; /* The procedure to call. */
+ ClientData clientData; /* Arbitrary one-word data to pass
+ * to the callback. */
+ struct CloseCallback *nextPtr; /* For chaining close callbacks. */
+} CloseCallback;
+
+/*
* Static functions in this file:
*/
@@ -504,6 +516,8 @@ Tcl_DeleteCloseHandler(chan, proc, clientData)
if ((cbPtr->proc == proc) && (cbPtr->clientData == clientData)) {
if (cbPrevPtr == (CloseCallback *) NULL) {
statePtr->closeCbPtr = cbPtr->nextPtr;
+ } else {
+ cbPrevPtr->nextPtr = cbPtr->nextPtr;
}
ckfree((char *) cbPtr);
break;