diff options
author | dgp <dgp@users.sourceforge.net> | 2013-02-25 18:15:36 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2013-02-25 18:15:36 (GMT) |
commit | 665eff0bf84eefb902865adc4f6ce46862cc5710 (patch) | |
tree | 9f828e28ad786df4789c04b0667899c12cc249a2 /generic/tclIO.c | |
parent | 03459bb0e1db5fd78e217ee768fe0ee1869ce9a7 (diff) | |
parent | 3113125de488bc505861db30785af63bae2e531c (diff) | |
download | tcl-665eff0bf84eefb902865adc4f6ce46862cc5710.zip tcl-665eff0bf84eefb902865adc4f6ce46862cc5710.tar.gz tcl-665eff0bf84eefb902865adc4f6ce46862cc5710.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.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/generic/tclIO.c b/generic/tclIO.c index de7f228..40998cc 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: */ @@ -563,6 +575,8 @@ Tcl_DeleteCloseHandler( if ((cbPtr->proc == proc) && (cbPtr->clientData == clientData)) { if (cbPrevPtr == NULL) { statePtr->closeCbPtr = cbPtr->nextPtr; + } else { + cbPrevPtr->nextPtr = cbPtr->nextPtr; } ckfree((char *) cbPtr); break; |