summaryrefslogtreecommitdiffstats
path: root/generic/tclBasic.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2021-05-26 10:28:11 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2021-05-26 10:28:11 (GMT)
commit0e90b5c0cf5d0cf25ebb0ef40f1e014f675b7b0c (patch)
tree9d29cac7c763ccb8b87c00eef67590e467d3ff51 /generic/tclBasic.c
parent15ba6741cfdbedfb264478ebef44ba013cf9fd97 (diff)
parent9d13d5e64b0b91da24a22b1ac9e2d3bc403c433e (diff)
downloadtcl-0e90b5c0cf5d0cf25ebb0ef40f1e014f675b7b0c.zip
tcl-0e90b5c0cf5d0cf25ebb0ef40f1e014f675b7b0c.tar.gz
tcl-0e90b5c0cf5d0cf25ebb0ef40f1e014f675b7b0c.tar.bz2
Merge 8.7. Add "ilp32" build flag
Diffstat (limited to 'generic/tclBasic.c')
-rw-r--r--generic/tclBasic.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/generic/tclBasic.c b/generic/tclBasic.c
index 833101c..f083c37 100644
--- a/generic/tclBasic.c
+++ b/generic/tclBasic.c
@@ -1826,28 +1826,28 @@ DeleteInterpProc(
ckfree(hTablePtr);
}
- /*
- * Invoke deletion callbacks; note that a callback can create new
- * callbacks, so we iterate.
- */
- while (iPtr->assocData != NULL) {
+ if (iPtr->assocData != NULL) {
AssocData *dPtr;
hTablePtr = iPtr->assocData;
- iPtr->assocData = NULL;
+ /*
+ * Invoke deletion callbacks; note that a callback can create new
+ * callbacks, so we iterate.
+ */
for (hPtr = Tcl_FirstHashEntry(hTablePtr, &search);
hPtr != NULL;
hPtr = Tcl_FirstHashEntry(hTablePtr, &search)) {
dPtr = (AssocData *)Tcl_GetHashValue(hPtr);
- Tcl_DeleteHashEntry(hPtr);
if (dPtr->proc != NULL) {
dPtr->proc(dPtr->clientData, interp);
}
+ Tcl_DeleteHashEntry(hPtr);
ckfree(dPtr);
}
Tcl_DeleteHashTable(hTablePtr);
ckfree(hTablePtr);
+ iPtr->assocData = NULL;
}
/*
@@ -3505,15 +3505,14 @@ Tcl_DeleteCommandFromToken(
cmdPtr->flags |= CMD_DYING;
/*
- * Call trace functions for the command being deleted. Then delete its
- * traces.
+ * Call each functions and then delete the trace.
*/
cmdPtr->nsPtr->refCount++;
if (cmdPtr->tracePtr != NULL) {
CommandTrace *tracePtr;
- /* Note that CallCommandTraces() never frees cmdPtr, that's
+ /* CallCommandTraces() does not cmdPtr, that's
* done just before Tcl_DeleteCommandFromToken() returns */
CallCommandTraces(iPtr,cmdPtr,NULL,NULL,TCL_TRACE_DELETE);