summaryrefslogtreecommitdiffstats
path: root/generic/tclBasic.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2012-06-11 17:49:12 (GMT)
committerdgp <dgp@users.sourceforge.net>2012-06-11 17:49:12 (GMT)
commit2b44404206c55f2894ce4b297fbce6176a70cf66 (patch)
tree2de722a252b06dbff9c8bac7239a3b99d8fcbf85 /generic/tclBasic.c
parente39d5419c36351fd1e67f48b94934998ddf15785 (diff)
parent45d29cd41c215484eaf33a4f02be315a6b1872b9 (diff)
downloadtcl-2b44404206c55f2894ce4b297fbce6176a70cf66.zip
tcl-2b44404206c55f2894ce4b297fbce6176a70cf66.tar.gz
tcl-2b44404206c55f2894ce4b297fbce6176a70cf66.tar.bz2
3532959 Make sure the lifetime management of entries in the linePBodyPtr hash
table can tolerate either order of teardown, interp first, or Proc first.
Diffstat (limited to 'generic/tclBasic.c')
-rw-r--r--generic/tclBasic.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/generic/tclBasic.c b/generic/tclBasic.c
index b38558a..0b02d0d 100644
--- a/generic/tclBasic.c
+++ b/generic/tclBasic.c
@@ -1555,12 +1555,16 @@ DeleteInterpProc(
hPtr != NULL;
hPtr = Tcl_NextHashEntry(&search)) {
CmdFrame *cfPtr = Tcl_GetHashValue(hPtr);
+ Proc *procPtr = (Proc *) Tcl_GetHashKey(iPtr->linePBodyPtr, hPtr);
- if (cfPtr->type == TCL_LOCATION_SOURCE) {
- Tcl_DecrRefCount(cfPtr->data.eval.path);
+ procPtr->iPtr = NULL;
+ if (cfPtr) {
+ if (cfPtr->type == TCL_LOCATION_SOURCE) {
+ Tcl_DecrRefCount(cfPtr->data.eval.path);
+ }
+ ckfree(cfPtr->line);
+ ckfree(cfPtr);
}
- ckfree(cfPtr->line);
- ckfree(cfPtr);
Tcl_DeleteHashEntry(hPtr);
}
Tcl_DeleteHashTable(iPtr->linePBodyPtr);