diff options
| author | kjnash <k.j.nash@usa.net> | 2020-08-28 01:53:33 (GMT) |
|---|---|---|
| committer | kjnash <k.j.nash@usa.net> | 2020-08-28 01:53:33 (GMT) |
| commit | bba42d0251c44fb8d13efa3b72c1b443dab6063f (patch) | |
| tree | 9533368b31032b1588674dc02ba2ce4c08217f20 /generic/tclBasic.c | |
| parent | 17058912aa60f6a98953579de27b7876ce1ec4dd (diff) | |
| parent | 1f7a1beab25bccf98fa6643e73672de5fb5b5fd1 (diff) | |
| download | tcl-bba42d0251c44fb8d13efa3b72c1b443dab6063f.zip tcl-bba42d0251c44fb8d13efa3b72c1b443dab6063f.tar.gz tcl-bba42d0251c44fb8d13efa3b72c1b443dab6063f.tar.bz2 | |
Merge 8.7
Diffstat (limited to 'generic/tclBasic.c')
| -rw-r--r-- | generic/tclBasic.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/generic/tclBasic.c b/generic/tclBasic.c index 4ee2ca0..2b1bae9 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -3547,6 +3547,19 @@ Tcl_DeleteCommandFromToken( iPtr->compileEpoch++; } + if (!(cmdPtr->flags & CMD_REDEF_IN_PROGRESS)) { + /* + * Delete any imports of this routine before deleting this routine itself. + * See issue 688fcc7082fa. + */ + for (refPtr = cmdPtr->importRefPtr; refPtr != NULL; + refPtr = nextRefPtr) { + nextRefPtr = refPtr->nextPtr; + importCmd = (Tcl_Command) refPtr->importedCmdPtr; + Tcl_DeleteCommandFromToken(interp, importCmd); + } + } + if (cmdPtr->deleteProc != NULL) { /* * Delete the command's client data. If this was an imported command @@ -3567,20 +3580,6 @@ Tcl_DeleteCommandFromToken( } /* - * If this command was imported into other namespaces, then imported - * commands were created that refer back to this command. Delete these - * imported commands now. - */ - if (!(cmdPtr->flags & CMD_REDEF_IN_PROGRESS)) { - for (refPtr = cmdPtr->importRefPtr; refPtr != NULL; - refPtr = nextRefPtr) { - nextRefPtr = refPtr->nextPtr; - importCmd = (Tcl_Command) refPtr->importedCmdPtr; - Tcl_DeleteCommandFromToken(interp, importCmd); - } - } - - /* * Don't use hPtr to delete the hash entry here, because it's possible * that the deletion callback renamed the command. Instead, use * cmdPtr->hptr, and make sure that no-one else has already deleted the |
