diff options
| author | dgp@users.sourceforge.net <dgp> | 2012-06-11 17:49:12 (GMT) |
|---|---|---|
| committer | dgp@users.sourceforge.net <dgp> | 2012-06-11 17:49:12 (GMT) |
| commit | 29e675489372730e2e369241bfba23a290e4fb48 (patch) | |
| tree | 2de722a252b06dbff9c8bac7239a3b99d8fcbf85 /generic/tclBasic.c | |
| parent | 47fc57545b3d1d2afd584e1b66789f5682a59e5c (diff) | |
| parent | ed29d6937bba52a576df069333776ac967c166eb (diff) | |
| download | tcl-29e675489372730e2e369241bfba23a290e4fb48.zip tcl-29e675489372730e2e369241bfba23a290e4fb48.tar.gz tcl-29e675489372730e2e369241bfba23a290e4fb48.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.c | 12 |
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); |
