summaryrefslogtreecommitdiffstats
path: root/generic/tclIO.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2013-02-25 18:17:26 (GMT)
committerdgp <dgp@users.sourceforge.net>2013-02-25 18:17:26 (GMT)
commit39e3f11942e49fab0df43f74043a5828d03a499e (patch)
tree1f21407e48e559afb20fde4343a3d1ceba744351 /generic/tclIO.c
parent96417ebbb891945d227820b007fe010cdad8d9ba (diff)
parente7941206981cd253e7ad628cb093823a34be62fc (diff)
downloadtcl-39e3f11942e49fab0df43f74043a5828d03a499e.zip
tcl-39e3f11942e49fab0df43f74043a5828d03a499e.tar.gz
tcl-39e3f11942e49fab0df43f74043a5828d03a499e.tar.bz2
Repair linked list management in Tcl_DeleteCloseHandler().
CloseCallback struct 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 f340d59..a7569f4 100644
--- a/generic/tclIO.c
+++ b/generic/tclIO.c
@@ -44,6 +44,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:
*/
@@ -695,6 +707,8 @@ Tcl_DeleteCloseHandler(
if ((cbPtr->proc == proc) && (cbPtr->clientData == clientData)) {
if (cbPrevPtr == NULL) {
statePtr->closeCbPtr = cbPtr->nextPtr;
+ } else {
+ cbPrevPtr->nextPtr = cbPtr->nextPtr;
}
ckfree(cbPtr);
break;