diff options
author | dgp <dgp@users.sourceforge.net> | 2016-12-02 15:39:31 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2016-12-02 15:39:31 (GMT) |
commit | e9d4e1005eda511d11d42c2e97ab39b7a1ff04c1 (patch) | |
tree | 28399f6d7a87b02906c3772dae81a2671b82f60a | |
parent | 74c17b45b2f27e8534077dc8ab1005a6bdb4fe14 (diff) | |
parent | 674aeae3b03a081aff35f8b1bba05e8e82040692 (diff) | |
download | tcl-e9d4e1005eda511d11d42c2e97ab39b7a1ff04c1.zip tcl-e9d4e1005eda511d11d42c2e97ab39b7a1ff04c1.tar.gz tcl-e9d4e1005eda511d11d42c2e97ab39b7a1ff04c1.tar.bz2 |
Relocate the cmdEpoch bumps during command deletion so that command resolution
caching works properly in deletion callbacks (destructors!) and delete traces.
-rw-r--r-- | generic/tclBasic.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/generic/tclBasic.c b/generic/tclBasic.c index c1dd52d..81b3513 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -3024,13 +3024,6 @@ Tcl_DeleteCommandFromToken( Tcl_Command importCmd; /* - * Bump the command epoch counter. This will invalidate all cached - * references that point to this command. - */ - - cmdPtr->cmdEpoch++; - - /* * The code here is tricky. We can't delete the hash table entry before * invoking the deletion callback because there are cases where the * deletion callback needs to invoke the command (e.g. object systems such @@ -3052,6 +3045,14 @@ Tcl_DeleteCommandFromToken( Tcl_DeleteHashEntry(cmdPtr->hPtr); cmdPtr->hPtr = NULL; } + + /* + * Bump the command epoch counter. This will invalidate all cached + * references that point to this command. + */ + + cmdPtr->cmdEpoch++; + return 0; } @@ -3154,6 +3155,13 @@ Tcl_DeleteCommandFromToken( if (cmdPtr->hPtr != NULL) { Tcl_DeleteHashEntry(cmdPtr->hPtr); cmdPtr->hPtr = NULL; + + /* + * Bump the command epoch counter. This will invalidate all cached + * references that point to this command. + */ + + cmdPtr->cmdEpoch++; } /* |